]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport PR c++/61198 fix
authorJonathan Wakely <jwakely@redhat.com>
Fri, 18 Mar 2016 15:57:58 +0000 (15:57 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 18 Mar 2016 15:57:58 +0000 (15:57 +0000)
gcc:
2014-12-19  Kai Tietz  <ktietz@redhat.com>

PR c++/61198
* pt.c (most_general_template): Don't break for template-alias.

gcc/testsuite:

2014-12-19  Kai Tietz  <ktietz@redhat.com>
    Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/61198
* g++.dg/cpp0x/alias-decl-45.C: New file.

From-SVN: r234337

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

index 11a92254cbd75713cb5feec12ec9e81d91977ba2..2f565db17f5d562db8770c271e5668556185b40a 100644 (file)
@@ -1,3 +1,11 @@
+2016-03-18  Jonathan Wakely  <jwakely@redhat.com>
+
+       Backported from mainline
+       2014-12-19  Kai Tietz  <ktietz@redhat.com>
+
+       PR c++/61198
+       * pt.c (most_general_template): Don't break for template-alias.
+
 2016-03-03  Jason Merrill  <jason@redhat.com>
 
        PR c++/65061
index 5bcdb156bb35784f42d2a5cea808b6909014a084..cece89ea30125d543ee65ca4d217b403d9eab947 100644 (file)
@@ -18873,6 +18873,7 @@ most_general_template (tree decl)
        break;
 
       if (CLASS_TYPE_P (TREE_TYPE (decl))
+         && !TYPE_DECL_ALIAS_P (TYPE_NAME (TREE_TYPE (decl)))
          && CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl)))
        break;
 
index d75573b994a840e038fd76088e69cdf5235f326d..548764efe5161af57544ba00ff86b1869614f1e9 100644 (file)
@@ -1,3 +1,12 @@
+2016-03-18  Jonathan Wakely  <jwakely@redhat.com>
+
+       Backported from mainline
+       2014-12-19  Kai Tietz  <ktietz@redhat.com>
+                   Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/61198
+       * g++.dg/cpp0x/alias-decl-45.C: New file.
+
 2016-03-15  Bernd Schmidt  <bschmidt@redhat.com>
 
        Backport from mainline
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-45.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-45.C
new file mode 100644 (file)
index 0000000..e3434f5
--- /dev/null
@@ -0,0 +1,24 @@
+// PR c++/61198
+// { dg-do compile { target c++11 } }
+
+template<int herp, typename derp_t>
+struct broken
+{
+       template<typename target_t>
+       using rebind = broken<herp, target_t>;
+};
+
+template<typename derp_t>
+struct broken<2, derp_t>
+{
+       template<typename target_t>
+       using rebind = broken<2, target_t>;
+};
+
+int main(int argc, char **argv)
+{              
+       broken<2, float>::rebind<double> u;
+
+       return 0;
+}
+