summaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-27 19:31:33 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-27 19:31:33 +0000
commitca63c29a80eadc10563d1c6d8ce0d4b3884ad930 (patch)
tree935f90ff364485ab5facda1e86039d079df9a040 /gcc/cp/decl2.c
parentc99de5410bf4296b7138c0813696e8c19b412902 (diff)
downloadgcc-ca63c29a80eadc10563d1c6d8ce0d4b3884ad930.tar.gz
* parser.c (cp_parser_ctor_initializer_opt_and_function_body):
Make sure a constexpr ctor has an empty body. * class.c (type_has_constexpr_default_constructor): New. * cp-tree.h: Declare it. * init.c (perform_member_init): Complain about uninitialized member in constexpr ctor. (emit_mem_initializers): And uninitialized base. * decl.c (check_tag_decl): Fix typo. * semantics.c (valid_type_in_constexpr_fundecl_p): New fn. (is_valid_constexpr_fn): New fn. (validate_constexpr_fundecl): Use it. * decl.c (validate_constexpr_redeclaration): New. (duplicate_decls): Use it. (cp_finish_decl): Call validate_constexpr_fundecl and ensure_literal_type_for_constexpr_object here. (start_decl): Not here. Don't ICE on constexpr reference. (check_for_uninitialized_const_var): Don't handle constexpr specially. (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P. (check_static_variable_definition): Give friendly message about missing constexpr. (grokdeclarator): Complain about typedef and volatile with constexpr. Reorganize. Give sorry about non-static data members in C++0x mode. (start_preparsed_function): Check validate_constexpr_fundecl here. (check_function_type): Not here. * decl2.c (finish_static_data_member_decl): Don't complain about in-class init. * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New. (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq. (cp_parser_decl_specifier_seq): Handle it. (cp_parser_explicit_instantiation): Diagnose inline and constexpr. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166013 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index f27e7d60856..13fa5f69890 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -771,21 +771,6 @@ finish_static_data_member_decl (tree decl,
permerror (input_location, "local class %q#T shall not have static data member %q#D",
current_class_type, decl);
- /* Static consts need not be initialized in the class definition. */
- if (init != NULL_TREE && TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)))
- {
- static int explained = 0;
-
- error ("initializer invalid for static member with constructor");
- if (!explained)
- {
- error ("(an out of class initialization is required)");
- explained = 1;
- }
- init = NULL_TREE;
- }
-
- DECL_INITIAL (decl) = init;
DECL_IN_AGGR_P (decl) = 1;
if (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE