re PR c++/77545 (ICE on valid C++11 code: in potential_constant_expression_1, at cp/constexpr.c:5480)
PR c++/77545 PR c++/77284 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT. * g++.dg/cpp0x/range-for32.C: New test. * g++.dg/cpp0x/range-for33.C: New test. From-SVN: r244062
This commit is contained in:
parent
5dd9a9d0c9
commit
baf9ebc8cc
5 changed files with 44 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2017-01-04 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/77545
|
||||
PR c++/77284
|
||||
* constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
|
||||
|
||||
2017-01-04 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
PR c++/66735
|
||||
|
|
|
@ -5661,6 +5661,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
|
|||
/* We can see these in statement-expressions. */
|
||||
return true;
|
||||
|
||||
case CLEANUP_STMT:
|
||||
case EMPTY_CLASS_EXPR:
|
||||
return false;
|
||||
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
2017-01-04 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/77545
|
||||
PR c++/77284
|
||||
* g++.dg/cpp0x/range-for32.C: New test.
|
||||
* g++.dg/cpp0x/range-for33.C: New test.
|
||||
|
||||
2017-01-04 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* gcc.dg/Wmissing-braces-fixits.c: New test case.
|
||||
|
|
16
gcc/testsuite/g++.dg/cpp0x/range-for32.C
Normal file
16
gcc/testsuite/g++.dg/cpp0x/range-for32.C
Normal file
|
@ -0,0 +1,16 @@
|
|||
// PR c++/77545
|
||||
// { dg-do compile { target c++11 } }
|
||||
// { dg-options "-Wno-pedantic" }
|
||||
|
||||
template < typename T > struct A
|
||||
{
|
||||
A ();
|
||||
~A ();
|
||||
T t;
|
||||
};
|
||||
|
||||
void f (A < int > a)
|
||||
{
|
||||
for (auto x : (A<int>[]) { a })
|
||||
;
|
||||
}
|
14
gcc/testsuite/g++.dg/cpp0x/range-for33.C
Normal file
14
gcc/testsuite/g++.dg/cpp0x/range-for33.C
Normal file
|
@ -0,0 +1,14 @@
|
|||
// PR c++/77284
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
#include <initializer_list>
|
||||
|
||||
struct A
|
||||
{
|
||||
~A () {}
|
||||
};
|
||||
|
||||
void foo (A & v)
|
||||
{
|
||||
for (A a : { v }) {};
|
||||
}
|
Loading…
Add table
Reference in a new issue