summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-05 18:24:06 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-05 18:24:06 +0000
commit30afdfe92bd0ec13c355834182e0ddc6e5f20062 (patch)
tree2904c8e428452b63c7ee221d28f8d8dfa942d509 /gcc/testsuite/g++.old-deja
parent6d88799aa5faeb7945abf42b8263d2d73dbb750d (diff)
downloadgcc-30afdfe92bd0ec13c355834182e0ddc6e5f20062.tar.gz
Implement constexpr variable templates
* decl.c (grokvardecl): Handle specializations of variable templates. (grokdeclarator): Handle variable template id expressions and NULL_TREE return from grokvardecl. * decl2.c (check_member_template): Allow declaration of template member variables. * parser.c (cp_parser_template_id): Build a TEMPLATE_ID_EXPR for variable templates. * pt.c (check_template_variable): Accept variable temploids at non-class scope. (push_template_decl_real): The current instantiation of a template can be a VAR_DECL. (determine_specialization): Accept variable templates. (check_explicit_specialization): Handle and check for malformed variable template specializations. (lookup_template_variable): New. (tsubst_decl): Handle variable template specializations. (do_decl_instantiation): Handle template variables. (instantiate_decl): Handle template variables. * semantics.c (finish_template_variable): New. (finish_id_expression): Instantiate variable templates. * cp-tree.h (variable_template_p): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213641 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.old-deja')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.oliva/template10.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/var1.C3
2 files changed, 3 insertions, 2 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/template10.C b/gcc/testsuite/g++.old-deja/g++.oliva/template10.C
index 5c1204bddcf..34e7224be45 100644
--- a/gcc/testsuite/g++.old-deja/g++.oliva/template10.C
+++ b/gcc/testsuite/g++.old-deja/g++.oliva/template10.C
@@ -19,4 +19,4 @@ template<> struct A<int> {
};
bool A<int>::a = true; // ok
-template<> bool A<int>::b = false; // { dg-error "template header" }
+template<> bool A<int>::b = false; // { dg-error "template (header|variable)" }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/var1.C b/gcc/testsuite/g++.old-deja/g++.pt/var1.C
index a15743d3e56..ec91bc47672 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/var1.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/var1.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
// Origin: Jason Merrill <jason@cygnus.com>
+// { dg-excess-errors "sorry" }
-template <class T> T t; // { dg-error "" } template declaration of t
+template <class T> T t; // template declaration of t