aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-02-25 13:53:45 -0500
committerJason Merrill <jason@gcc.gnu.org>2014-02-25 13:53:45 -0500
commitd808e92ea950feeba41a5019ada7cddbbe0a5ed7 (patch)
tree06b9b9b43702659f9754fed7fd2fdfd7d8c8a70e /gcc
parent3af78158aa01b0d43b546038b7fddc2c63533121 (diff)
downloadgcc-d808e92ea950feeba41a5019ada7cddbbe0a5ed7.zip
gcc-d808e92ea950feeba41a5019ada7cddbbe0a5ed7.tar.gz
gcc-d808e92ea950feeba41a5019ada7cddbbe0a5ed7.tar.bz2
DR 1286 PR c++/60328
DR 1286 PR c++/60328 * pt.c (get_underlying_template): Fix equivalence calculation. From-SVN: r208152
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c7
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1286b.C12
3 files changed, 23 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5afc6d8..7f63b8e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2014-02-25 Jason Merrill <jason@redhat.com>
+
+ DR 1286
+ PR c++/60328
+ * pt.c (get_underlying_template): Fix equivalence calculation.
+
2014-02-25 Adam Butcher <adam@jessamine.co.uk>
PR c++/60311
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index bd59142..4a9fa71 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5185,9 +5185,12 @@ get_underlying_template (tree tmpl)
tree sub = TYPE_TI_TEMPLATE (result);
if (PRIMARY_TEMPLATE_P (sub)
&& (num_innermost_template_parms (tmpl)
- == num_innermost_template_parms (sub))
- && same_type_p (result, TREE_TYPE (sub)))
+ == num_innermost_template_parms (sub)))
{
+ tree alias_args = INNERMOST_TEMPLATE_ARGS
+ (template_parms_to_args (DECL_TEMPLATE_PARMS (tmpl)));
+ if (!comp_template_args (TYPE_TI_ARGS (result), alias_args))
+ break;
/* The alias type is equivalent to the pattern of the
underlying template, so strip the alias. */
tmpl = sub;
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1286b.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1286b.C
new file mode 100644
index 0000000..fef9818
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1286b.C
@@ -0,0 +1,12 @@
+// PR c++/60328
+// { dg-require-effective-target c++11 }
+
+template <class _T, class... _Rest>
+struct Foo
+{
+ template <class _TT, class... _RR>
+ using Bar = Foo<_TT, _RR...>;
+
+ using Normal = Foo<_Rest...>;
+ using Fail = Bar<_Rest...>;
+};