aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-03-10 13:44:48 -0400
committerJason Merrill <jason@gcc.gnu.org>2015-03-10 13:44:48 -0400
commita4d66d7dc7a140adf8d2bfb87d4d6354abc7b340 (patch)
tree0b6274d1f52d11ac5bbf74b8b496340314774465 /gcc
parentc42345448f356031cbb9f6cce1ed918f299f8891 (diff)
downloadgcc-a4d66d7dc7a140adf8d2bfb87d4d6354abc7b340.zip
gcc-a4d66d7dc7a140adf8d2bfb87d4d6354abc7b340.tar.gz
gcc-a4d66d7dc7a140adf8d2bfb87d4d6354abc7b340.tar.bz2
re PR c++/65333 (error: incomplete type used in nested name specifier)
PR c++/65333 DR 1558 * pt.c (dependent_type_p_r): Check both class and alias template args. From-SVN: r221328
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c8
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-47.C13
3 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d354e07..61c0b18 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/65333
+ DR 1558
+ * pt.c (dependent_type_p_r): Check both class and alias template args.
+
2015-03-10 Jakub Jelinek <jakub@redhat.com>
PR c/65120
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 9a00d0d..ea82621 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -20930,7 +20930,13 @@ dependent_type_p_r (tree type)
return true;
/* ... or any of the template arguments is a dependent type or
an expression that is type-dependent or value-dependent. */
- else if (TYPE_TEMPLATE_INFO (type)
+ else if (CLASS_TYPE_P (type) && CLASSTYPE_TEMPLATE_INFO (type)
+ && (any_dependent_template_arguments_p
+ (INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (type)))))
+ return true;
+ /* For an alias template specialization, check the arguments both to the
+ class template and the alias template. */
+ else if (alias_template_specialization_p (type)
&& (any_dependent_template_arguments_p
(INNERMOST_TEMPLATE_ARGS (TYPE_TI_ARGS (type)))))
return true;
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-47.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-47.C
new file mode 100644
index 0000000..71611db
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-47.C
@@ -0,0 +1,13 @@
+// PR c++/65333
+// { dg-do compile { target c++11 } }
+
+template <typename T, T... Values> struct A
+{
+ using type = int;
+ template <type... Suffix> using array = A<type, Values..., Suffix...>;
+ void
+ m_fn1 ()
+ {
+ array<>::data;
+ }
+};