Commit ae8310ec by Marek Polacek Committed by Marek Polacek

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
parent b654717c
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> 2013-12-20 Trevor saunders <tsaunders@mozilla.com>
* semantics.c (build_anon_member_initialization): Replace * semantics.c (build_anon_member_initialization): Replace
......
...@@ -2506,7 +2506,7 @@ lookup_conversions (tree type) ...@@ -2506,7 +2506,7 @@ lookup_conversions (tree type)
tree list = NULL_TREE; tree list = NULL_TREE;
complete_type (type); complete_type (type);
if (!TYPE_BINFO (type)) if (!CLASS_TYPE_P (type) || !TYPE_BINFO (type))
return NULL_TREE; return NULL_TREE;
lookup_conversions_r (TYPE_BINFO (type), 0, 0, lookup_conversions_r (TYPE_BINFO (type), 0, 0,
......
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> 2013-12-22 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/x86_64/abi/callabi/func-2a.c (dg-do): Remove * gcc.target/x86_64/abi/callabi/func-2a.c (dg-do): Remove
......
// 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" }
// PR c++/59110
// { dg-options "-std=c++1y" }
int i = *(auto*)0; // { dg-error "cannot convert" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment