diff options
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/alias-decl-20.C | 9 |
4 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4d1fc5ce27c..58010047555 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2012-07-06 Jason Merrill <jason@redhat.com> + + PR c++/53858 + * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P. + 2012-07-05 Jason Merrill <jason@redhat.com> PR c++/53039 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index cc8439c9ccd..97581d914a2 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 939bea1d9f9..18187f1a60d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-07-06 Jason Merrill <jason@redhat.com> + + PR c++/53858 + * g++.dg/cpp0x/alias-decl-20.C: New. + 2012-07-06 Tom de Vries <tom@codesourcery.com> 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 00000000000..078d257187a --- /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 <typename T> struct s0 { typedef T tdef0; }; +template <typename T> struct s1 { typedef T tdef1; }; +template <typename T> using us1 = typename s1<T>::tdef1; +template <typename T, typename TT = typename us1<T>::tdef0> struct s2 {}; + +int main () { return 0; } |