From d30a17fc577b895a3a7398a3ae8715e01e23d845 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 6 Jul 2012 10:00:31 -0400 Subject: re PR c++/53858 ([C++11] template aliases used in template parameters default expression) PR c++/53858 * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P. From-SVN: r189331 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/name-lookup.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/alias-decl-20.C | 9 +++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-20.C (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4d1fc5c..5801004 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2012-07-06 Jason Merrill + + PR c++/53858 + * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P. + 2012-07-05 Jason Merrill PR c++/53039 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index cc8439c..97581d9 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4059,7 +4059,7 @@ ambiguous_decl (struct scope_binding *old, cxx_binding *new_binding, int flags) /* If we expect types or namespaces, and not templates, or this is not a template class. */ if ((LOOKUP_QUALIFIERS_ONLY (flags) - && !DECL_CLASS_TEMPLATE_P (val))) + && !DECL_TYPE_TEMPLATE_P (val))) val = NULL_TREE; break; case TYPE_DECL: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 939bea1..18187f1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-07-06 Jason Merrill + + PR c++/53858 + * g++.dg/cpp0x/alias-decl-20.C: New. + 2012-07-06 Tom de Vries PR tree-optimization/51879 diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-20.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-20.C new file mode 100644 index 0000000..078d257 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-20.C @@ -0,0 +1,9 @@ +// PR c++/53858 +// { dg-do compile { target c++11 } } + +template struct s0 { typedef T tdef0; }; +template struct s1 { typedef T tdef1; }; +template using us1 = typename s1::tdef1; +template ::tdef0> struct s2 {}; + +int main () { return 0; } -- cgit v1.1