aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@gcc.gnu.org>2015-07-13 20:35:53 +0000
committerPatrick Palka <ppalka@gcc.gnu.org>2015-07-13 20:35:53 +0000
commit15d6614a167abb8191fa844ca140b53f8e0dfd40 (patch)
treef528942805d52eec8337aad96e9a5e3bc41b2e95 /gcc
parent795038b72255040a9e62cc5da08bd6a6b5d11286 (diff)
downloadgcc-15d6614a167abb8191fa844ca140b53f8e0dfd40.zip
gcc-15d6614a167abb8191fa844ca140b53f8e0dfd40.tar.gz
gcc-15d6614a167abb8191fa844ca140b53f8e0dfd40.tar.bz2
re PR c++/65186 (internal compiler error: in tsubst, at cp/pt.c:11738)
Fix PR c++/65186 gcc/cp/ChangeLog: PR c++/65186 * pt.c (invalid_nontype_parm_type_p): Accept a bound template template parm type under C++11 and later. gcc/testsuite/ChangeLog: PR c++/65186 * g++.dg/template/pr65186.C: New test. From-SVN: r225749
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/pr65186.C26
4 files changed, 42 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a33b649..df2e0b2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2015-07-13 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/65186
+ * pt.c (invalid_nontype_parm_type_p): Accept a bound template
+ template parm type under C++11 and later.
+
2015-07-12 Aldy Hernandez <aldyh@redhat.com>
* call.c: Fix double word typos.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 064cbfd..2097963 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -20996,6 +20996,11 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
return 0;
else if (TREE_CODE (type) == NULLPTR_TYPE)
return 0;
+ /* A bound template template parm could later be instantiated to have a valid
+ nontype parm type via an alias template. */
+ else if (cxx_dialect >= cxx11
+ && TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM)
+ return 0;
if (complain & tf_error)
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 071e7c4..2e32e14 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-13 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/65186
+ * g++.dg/template/pr65186.C: New test.
+
2015-07-13 Mantas Mikaitis <mantas.mikaitis@arm.com>
* gcc.target/arm/macro_defs0.c: Add directive to skip
diff --git a/gcc/testsuite/g++.dg/template/pr65186.C b/gcc/testsuite/g++.dg/template/pr65186.C
new file mode 100644
index 0000000..f5e81e3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/pr65186.C
@@ -0,0 +1,26 @@
+// { dg-do compile { target c++11 } }
+// PR c++/65186
+
+template<typename A, A x, A y>
+using Id = int;
+
+template<
+ typename A,
+ A x,
+ A y,
+ Id<A, x, y> p,
+ template<A a, A b, Id<A, a, b>> class C,
+ C<x, x, x> // { dg-bogus "not a valid type" }
+> using J = C<x, y, p>;
+
+
+template<class A>
+using Z = A;
+
+template<
+ template <class> class A,
+ A<int> B // { dg-bogus "not a valid type" }
+>
+struct C { };
+
+C<Z, 5> a;