re PR c++/59111 ([c++11] ICE on invalid usage of auto in return type)

PR c++/59111
cp/
	* search.c (lookup_conversions): Return NULL_TREE if !CLASS_TYPE_P.
testsuite/
	* g++.dg/cpp0x/pr59111.C: New test.
	* g++.dg/cpp1y/pr59110.C: New test.

From-SVN: r206177
This commit is contained in:
Marek Polacek 2013-12-23 12:14:56 +00:00 committed by Marek Polacek
parent b654717c8d
commit ae8310ec6e
5 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-12-23 Marek Polacek <polacek@redhat.com>
PR c++/59111
* search.c (lookup_conversions): Return NULL_TREE if !CLASS_TYPE_P.
2013-12-20 Trevor saunders <tsaunders@mozilla.com>
* semantics.c (build_anon_member_initialization): Replace

View File

@ -2506,7 +2506,7 @@ lookup_conversions (tree type)
tree list = NULL_TREE;
complete_type (type);
if (!TYPE_BINFO (type))
if (!CLASS_TYPE_P (type) || !TYPE_BINFO (type))
return NULL_TREE;
lookup_conversions_r (TYPE_BINFO (type), 0, 0,

View File

@ -1,3 +1,9 @@
2013-12-23 Marek Polacek <polacek@redhat.com>
PR c++/59111
* g++.dg/cpp0x/pr59111.C: New test.
* g++.dg/cpp1y/pr59110.C: New test.
2013-12-22 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/x86_64/abi/callabi/func-2a.c (dg-do): Remove

View File

@ -0,0 +1,5 @@
// PR c++/59111
// { dg-do compile { target c++11 } }
auto& foo(); // { dg-error "type specifier without trailing return type" }
int i = foo(); // { dg-error "cannot convert" }

View File

@ -0,0 +1,4 @@
// PR c++/59110
// { dg-options "-std=c++1y" }
int i = *(auto*)0; // { dg-error "cannot convert" }