diff options
author | Jason Merrill <jason@redhat.com> | 2011-08-16 19:25:43 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-08-16 19:25:43 -0400 |
commit | 098416302ba1d50a7f183e8643a2563a255b744a (patch) | |
tree | a9ae3617c19a3f61ed9cc56ea528ba813e209f2f /gcc | |
parent | 565fc114d978d910a44b9498e1b65fa51f02b3e3 (diff) | |
download | gcc-098416302ba1d50a7f183e8643a2563a255b744a.zip gcc-098416302ba1d50a7f183e8643a2563a255b744a.tar.gz gcc-098416302ba1d50a7f183e8643a2563a255b744a.tar.bz2 |
re PR c++/50054 (Fails to recover from type error in function signature)
PR c++/50054
* typeck2.c (cxx_incomplete_type_diagnostic): Handle
init_list_type_node.
From-SVN: r177810
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/initlist57.C | 8 |
4 files changed, 25 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a18a24c..ea1a8d0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-08-16 Jason Merrill <jason@redhat.com> + + PR c++/50054 + * typeck2.c (cxx_incomplete_type_diagnostic): Handle + init_list_type_node. + 2011-08-13 Jason Merrill <jason@redhat.com> PR c++/50075 diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 0788138..79aa354 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -450,6 +450,12 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type, break; case LANG_TYPE: + if (type == init_list_type_node) + { + emit_diagnostic (diag_kind, input_location, 0, + "invalid use of brace-enclosed initializer list"); + break; + } gcc_assert (type == unknown_type_node); if (value && TREE_CODE (value) == COMPONENT_REF) goto bad_member; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 54053b9..2e56e74 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-08-16 Jason Merrill <jason@redhat.com> + + PR c++/50054 + * g++.dg/cpp0x/initlist56.C: New. + 2011-08-15 H.J. Lu <hongjiu.lu@intel.com> PR testsuite/50085 diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist57.C b/gcc/testsuite/g++.dg/cpp0x/initlist57.C new file mode 100644 index 0000000..d945a46 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist57.C @@ -0,0 +1,8 @@ +// PR c++/50054 +// { dg-options -std=c++0x } + +void g( const int& (a)[1] ) {} // { dg-error "array of references" } + +int main () { + g( { 1, 2 } ); // { dg-error "initializer list" } +} |