From 03719af81d81a96aeec4921e0989e589d42bae68 Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 4 Apr 2017 15:25:21 +0000 Subject: [PATCH] * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246680 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/semantics.c | 1 + gcc/testsuite/g++.dg/concepts/regress/alias-decl-42.C | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/g++.dg/concepts/regress/alias-decl-42.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 01baeb810ab..a28dcb5c638 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2017-04-03 Jason Merrill + + * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO. + 2017-04-03 Jonathan Wakely * class.c (update_vtable_entry_for_fn): Fix typo in comment. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index c57264623d1..0a695008ada 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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 index 00000000000..611a89608bc --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/regress/alias-decl-42.C @@ -0,0 +1,18 @@ +// PR c++/59200 +// { dg-options "-std=c++1z -fconcepts" } + +struct A +{ + static constexpr bool value = true; +}; + +template +struct B +{ + template + using C = A; +}; + +template +template + const bool B::C::value; // { dg-error "too many" } -- 2.11.4.GIT