re PR c++/53858 ([C++11] template aliases used in template parameters default expression)
authorJason Merrill <jason@redhat.com>
Fri, 6 Jul 2012 14:00:31 +0000 (10:00 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 6 Jul 2012 14:00:31 +0000 (10:00 -0400)
PR c++/53858
* name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P.

From-SVN: r189331

gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/alias-decl-20.C [new file with mode: 0644]

index 4d1fc5ce27c1170e88078e34c81c8c2d87f0d3b6..58010047555d914d7ba55cad31a89338afa8f4dc 100644 (file)
@@ -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
index cc8439c9ccd6f8ec906e3772d12baf81927e8588..97581d914a2c5f234d1754e321c49f576b928bde 100644 (file)
@@ -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:
index 939bea1d9f9ac3fb8b624f25ff9ddc79cf599e54..18187f1a60daa1693c1865c8efd3161a72c8e454 100644 (file)
@@ -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 (file)
index 0000000..078d257
--- /dev/null
@@ -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; }