From f27a59cf8a51f4c28cec55545673405b20a02a98 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sat, 25 Aug 2012 09:53:30 +0000 Subject: re PR c++/51421 ([c++0x] ICE with invalid use of auto) /cp 2012-08-25 Paolo Carlini PR c++/51421 * decl2.c (mark_used): Consistently return false after errors about uses before deduction of auto. * semantics.c (finish_id_expression): Check mark_used return value and return error_mark_node in case of failure. /testsuite 2012-08-25 Paolo Carlini PR c++/51421 * g++.dg/cpp0x/auto34.C: New. From-SVN: r190665 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/auto34.C | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/auto34.C (limited to 'gcc/testsuite') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index eeb62dc..94b23a4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-08-25 Paolo Carlini + + PR c++/51421 + * g++.dg/cpp0x/auto34.C: New. + 2012-08-24 Jakub Jelinek PR c/54363 diff --git a/gcc/testsuite/g++.dg/cpp0x/auto34.C b/gcc/testsuite/g++.dg/cpp0x/auto34.C new file mode 100644 index 0000000..3682d60 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto34.C @@ -0,0 +1,18 @@ +// PR c++/51421 +// { dg-do compile { target c++11 } } + +int foo1(int); + +void bar1() +{ + auto i = foo1(i); // { dg-error "before deduction" } +} + +struct A {}; + +A foo2(A); + +void bar2() +{ + auto a = foo2(a); // { dg-error "before deduction" } +} -- cgit v1.1