[C++ Patch] PR 37554

Paolo Carlini paolo.carlini@oracle.com
Tue Jan 27 18:51:00 GMT 2009


Hi,

this patchlet solves an ice-on-invalid, 4.4 (and 4.3) regression: I
changed the function to just return back error_mark_node
unconditionally. As regards crash9.C, I don't think we are regressing
with the error message. We get:

crash9.C: In function ‘void g(const C&)’:
crash9.C:10: error: invalid use of incomplete type ‘struct C’
crash9.C:6: error: forward declaration of ‘struct C’
crash9.C:10: error:   initializing argument 1 of ‘void f(T) [with T = C]’

compared to the current:

crash9.C: In function ‘void g(const C&)’:
crash9.C:10: error: invalid use of incomplete type ‘struct C’
crash9.C:6: error: forward declaration of ‘struct C’
crash9.C:10: error:   initializing argument 1 of ‘void f(T) [with T = C]’
crash9.C: In function ‘void f(T) [with T = C]’:
crash9.C:10:   instantiated from here
crash9.C:4: error: ‘<anonymous>’ has incomplete type
crash9.C:6: error: forward declaration of ‘struct C’

and to the old (e.g., in 4_2-branch):

crash9.C: In function ‘void f(T) [with T = C]’:
crash9.C:10:   instantiated from here
crash9.C:4: error: ‘<anonymous>’ has incomplete type
crash9.C:6: error: forward declaration of ‘struct C’

For comparison, ICC issues:

crash9.C(10): error: no instance of function template "f" matches the
argument list
            argument types are: (const C)
    f(c); // { dg-error "" } invalid use of undefined type

Tested x86_64-linux. Ok for mainline?

Paolo.

//////////////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_37554
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090127/6ba6b61c/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_37554
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090127/6ba6b61c/attachment-0001.ksh>


More information about the Gcc-patches mailing list