summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-09 17:33:02 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-09 17:33:02 +0000
commitdc9d9310a34d65a48616acd0a60ec889ff923ffb (patch)
tree72dce6660c8f0305d6023aaf4f8fd8d3760cacc4 /gcc/cp/pt.c
parenta6925cb3cef27000d9e84a5979448378f1861a45 (diff)
downloadgcc-dc9d9310a34d65a48616acd0a60ec889ff923ffb.tar.gz
PR c++/17524
* cp-tree.h (check_var_type): New function. * decl.c (check_var_type): New function, split out from ... (grokdeclarator): ... here. * pt.c (tsubst_decl): Use check_var_type. PR c++/17685 * decl.c (grokdeclarator): Disallow declarations of operators as PR c++/17524 * g++.dg/template/static9.C: New test. PR c++/17685 * g++.dg/parse/operator5.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88820 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 9a869eaecd2..c794e35bf4e 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6508,6 +6508,7 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
type = complete_type (type);
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (r)
= DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (t);
+ type = check_var_type (DECL_NAME (r), type);
}
else if (DECL_SELF_REFERENCE_P (t))
SET_DECL_SELF_REFERENCE_P (r);
@@ -6548,9 +6549,6 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
register_local_specialization (r, t);
TREE_CHAIN (r) = NULL_TREE;
- if (TREE_CODE (r) == VAR_DECL && VOID_TYPE_P (type))
- cp_error_at ("instantiation of %qD as type %qT", r, type);
- /* Compute the size, alignment, etc. of R. */
layout_decl (r, 0);
}
break;