[Bug fortran/58171] [F03] Incorrect error message on invalid code when using type constructor

2013-12-21 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58171

Dominique d'Humieres dominiq at lps dot ens.fr changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2013-12-21
 Ever confirmed|0   |1

--- Comment #3 from Dominique d'Humieres dominiq at lps dot ens.fr ---
Confirmed at r206155.


[Bug fortran/58171] [F03] Incorrect error message on invalid code when using type constructor

2013-08-19 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58171

janus at gcc dot gnu.org changed:

   What|Removed |Added

 CC||janus at gcc dot gnu.org
Summary|Incorrect error message on  |[F03] Incorrect error
   |invalid code when using |message on invalid code
   |class constructor   |when using type constructor

--- Comment #1 from janus at gcc dot gnu.org ---
Well, I think in situations like this it is not trivial for the compiler to
guess what you want to do: In principle 'structure constructors' and
'constructor functions' (i.e. generic procedures with the same name as the
derived type) can be used alongside each other.

In your case: Since the call of 'cps' does not have the right number of
arguments to match the 'newCps' function, it is interpreted as a 'structure
constructor', but this also fails since your type has private components.

The compiler can not really tell whether you forgot one argument in the call,
or if you actually intended to call a structure constructor but 'wrongly' gave
the type private components.

Btw, if you rename the type, you will get the following:

Error: There is no specific function for the generic 'cps' at (1)

Does that sound more like what you were expecting?

If yes, one could think about adding a special error for cases like this (where
the type has private components and a 'constructor' function is present).


[Bug fortran/58171] [F03] Incorrect error message on invalid code when using type constructor

2013-08-19 Thread abensonca at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58171

--- Comment #2 from Andrew Benson abensonca at gmail dot com ---
I see your point about it not being obvious what was intended in situations
like this. Something such as:

Error: There is no specific function for the generic 'cps' at (1)

would definitely be more helpful if it were possible to generate.