* semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
authorJason Merrill <jason@redhat.com>
Tue, 4 Apr 2017 15:25:21 +0000 (11:25 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 4 Apr 2017 15:25:21 +0000 (11:25 -0400)
From-SVN: r246680

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/g++.dg/concepts/regress/alias-decl-42.C [new file with mode: 0644]

index 01baeb810aba9e73ba235b9d43d7ff656246bd86..a28dcb5c6386b7a5ac03b8321544cc5b47272893 100644 (file)
@@ -1,3 +1,7 @@
+2017-04-03  Jason Merrill  <jason@redhat.com>
+
+       * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
+
 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
 
        * class.c (update_vtable_entry_for_fn): Fix typo in comment.
index c57264623d1472be70db5d98153c4df1f2216328..0a695008ada950e60a2d298146165e70df33ae4b 100644 (file)
@@ -3157,6 +3157,7 @@ finish_template_type (tree name, tree args, int entering_scope)
   if (flag_concepts
       && entering_scope
       && CLASS_TYPE_P (type)
+      && CLASSTYPE_TEMPLATE_INFO (type)
       && dependent_type_p (type)
       && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type)))
     type = fixup_template_type (type);
diff --git a/gcc/testsuite/g++.dg/concepts/regress/alias-decl-42.C b/gcc/testsuite/g++.dg/concepts/regress/alias-decl-42.C
new file mode 100644 (file)
index 0000000..611a896
--- /dev/null
@@ -0,0 +1,18 @@
+// PR c++/59200
+// { dg-options "-std=c++1z -fconcepts" }
+
+struct A
+{
+  static constexpr bool value = true;
+};
+
+template<typename T>
+struct B
+{
+  template<typename U>
+    using C = A;
+};
+
+template<typename T>
+template<typename U>
+  const bool B<T>::C<U>::value;  // { dg-error "too many" }