Message ID | 52D6F54F.2030406@oracle.com |
---|---|
State | New |
Headers | show |
.. patchlet fixes c++/58811 too. Paolo.
OK. Does returning error_mark_node from build_value_init in the case of erroneous type not work? Jason
On 01/17/2014 06:02 PM, Jason Merrill wrote: > OK. Thanks. > Does returning error_mark_node from build_value_init in the case of > erroneous type not work? Yeah, doesn't work in the sense that we regress to two errors instead of one (like in 4.8.x) on that testcase I mentioned at the beginning of this thread (sorry for not being more explicit) Paolo.
Index: cp/init.c =================================================================== --- cp/init.c (revision 206643) +++ cp/init.c (working copy) @@ -399,6 +399,9 @@ build_value_init_noctor (tree type, tsubst_flags_t ftype = TREE_TYPE (field); + if (ftype == error_mark_node) + continue; + /* We could skip vfields and fields of types with user-defined constructors, but I think that won't improve performance at all; it should be simpler in general just Index: testsuite/g++.dg/cpp0x/decltype-incomplete1.C =================================================================== --- testsuite/g++.dg/cpp0x/decltype-incomplete1.C (revision 0) +++ testsuite/g++.dg/cpp0x/decltype-incomplete1.C (working copy) @@ -0,0 +1,9 @@ +// PR c++/59270 +// { dg-do compile { target c++11 } } + +struct A +{ + struct B b; // { dg-error "incomplete type" } +}; + +decltype(A()) a;