re PR c++/47511 ([C++0x] ICE: unexpected ast of kind template_decl in potential_constant_expression_1, at cp/semantics.c:7711)

PR c++/47511
	* semantics.c (potential_constant_expression_1): Handle TEMPLATE_DECL.

From-SVN: r170005
This commit is contained in:
Jason Merrill 2011-02-10 11:29:39 -05:00 committed by Jason Merrill
parent 72602cd16b
commit 5b883ca61c
7 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2011-02-09 Jason Merrill <jason@redhat.com>
PR c++/47511
* semantics.c (potential_constant_expression_1): Handle TEMPLATE_DECL.
2011-02-03 Dodji Seketeli <dodji@redhat.com>
PR c++/47398

View File

@ -7263,6 +7263,7 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags)
{
case FUNCTION_DECL:
case BASELINK:
case TEMPLATE_DECL:
case OVERLOAD:
case TEMPLATE_ID_EXPR:
case LABEL_DECL:

View File

@ -1,3 +1,10 @@
2011-02-09 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/regress: New directory.
* g++.dg/cpp0x/constexpr-regress1.C: Move to regress/regress1.C.
* g++.dg/cpp0x/constexpr-regress2.C: Move to regress/regress2.C.
* g++.dg/cpp0x/regress/regress3.C: New.
2011-02-10 Richard Guenther <rguenther@suse.de>
PR tree-optimization/47677

View File

@ -0,0 +1,3 @@
This directory contains tests that were passing in C++98 mode but failing
in C++0x mode; it should be replaced by an improvement to the test harness
to run all tests in both modes.

View File

@ -0,0 +1,13 @@
// PR c++/47511
// { dg-options -std=c++0x }
namespace N {
template <typename T> bool g( T ) {
return true;
}
struct A { };
}
template <class T> void f(const T&) {
N::A x;
g(x) ;
}