diff options
author | Gabriel Dos Reis <gdr@cs.tamu.edu> | 2009-10-01 05:13:56 +0000 |
---|---|---|
committer | Gabriel Dos Reis <gdr@gcc.gnu.org> | 2009-10-01 05:13:56 +0000 |
commit | 7ecbca9d02206b8fcba2710daa9e0a366af65a8b (patch) | |
tree | dcaed29421b884419d98bd0b4cb2308838e9ea60 /gcc/cp/parser.c | |
parent | ec30ab2c798327e9d538b985a410ba79487ae801 (diff) | |
download | gcc-7ecbca9d02206b8fcba2710daa9e0a366af65a8b.zip gcc-7ecbca9d02206b8fcba2710daa9e0a366af65a8b.tar.gz gcc-7ecbca9d02206b8fcba2710daa9e0a366af65a8b.tar.bz2 |
tree.h (tree_decl_common::lang_flag_8): New.
gcc/
* tree.h (tree_decl_common::lang_flag_8): New.
* c-common.c (c_common_reswords): Include "constexpr" as C++0x
keyword.
* c-common.h (RID_CONSTEXPR): New.
gcc/cp/
* decl.c (check_for_uninitialized_const_var): Check constexpr
variables too.
(build_ptrmemfunc_type): Make the result a literal type.
(build_ptrmem_type): Likewise.
(grokdeclarator): Handle `constexpr'.
(check_tag_decl): Reject `constexpr'.
(check_function_type): Check constexpr functions.
* cp-tree.h (ds_constexpr): New cp_decl_spec enumerator.
(CLASSTYPE_LITERAL_P): New.
(lang_type_class::is_literal): New.
(lang_type_class::dummy): Adjust width.
(literal_type_p): Declare.
* parser.c (cp_parser_check_decl_spec): Print it.
(cp_parser_decl_specifier_seq): Accept "constexpr".
* semantics.c (validate_constexpr_fundecl): Define.
(literal_type_p): Define.
From-SVN: r152358
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 0ed7d2a..950d136 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -2195,6 +2195,7 @@ cp_parser_check_decl_spec (cp_decl_specifier_seq *decl_specs, "explicit", "friend", "typedef", + "constexpr", "__complex", "__thread" }; @@ -9030,7 +9031,8 @@ cp_parser_decl_specifier_seq (cp_parser* parser, switch (token->keyword) { /* decl-specifier: - friend */ + friend + constexpr */ case RID_FRIEND: if (!at_class_scope_p ()) { @@ -9045,6 +9047,11 @@ cp_parser_decl_specifier_seq (cp_parser* parser, } break; + case RID_CONSTEXPR: + ++decl_specs->specs[(int) ds_constexpr]; + cp_lexer_consume_token (parser->lexer); + break; + /* function-specifier: inline virtual |