diff options
author | dgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-21 20:23:03 +0000 |
---|---|---|
committer | dgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-21 20:23:03 +0000 |
commit | 7a05c4b1babf71f2899d30bac4c73544a44eda46 (patch) | |
tree | b93947409f894b645ef269b5199ac8efb6894453 /gcc/cp/lex.c | |
parent | df1683c2368b116e39b98dc3890d8dde3fbc77e1 (diff) | |
download | gcc-7a05c4b1babf71f2899d30bac4c73544a44eda46.tar.gz |
2006-11-21 Douglas Gregor <doug.gregor@gmail.com>
* cp-tree.def (STATIC_ASSERT): New.
* cp-objcp-common.c (cp_tree_size): Handle STATIC_ASSERT.
* error.c (dump_decl): Handle STATIC_ASSERT.
* cp-tree.h (STATIC_ASSERT_CONDITION): New.
(STATIC_ASSERT_MESSAGE): New.
(STATIC_ASSERT_SOURCE_LOCATION): New.
(struct tree_static_assert): New.
(enum cp_tree_node_structure_enum): Add TS_CP_STATIC_ASSERT.
(union lang_tree_node): Add static_assertion.
(finish_static_assert): Declare.
* cxx-pretty-print.c (pp_cxx_statement): Handle STATIC_ASSERT.
(pp_cxx_declaration): Handle STATIC_ASSERT.
* pt.c (instantiate_class_template): Handle
STATIC_ASSERT members.
(tsubst_expr): Handle STATIC_ASSERT statements.
* semantics.c (finish_static_assert): New.
* lex.c (D_CPP0X): New.
(reswords): Add static_assert keyword.
(init_reswords): If not flag_cpp0x, mask out C++0x keywords.
* parser.c (cp_parser_block_declaration): Parse static
assertions.
(cp_parser_static_assert): New.
(cp_parser_member_declaration): Parse static assertions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119066 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r-- | gcc/cp/lex.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index d14a1baa926..27a17c3d3fe 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -176,6 +176,7 @@ struct resword #define D_EXT 0x01 /* GCC extension */ #define D_ASM 0x02 /* in C99, but has a switch to turn it off */ #define D_OBJC 0x04 /* Objective C++ only */ +#define D_CPP0X 0x08 /* C++0x only */ CONSTRAINT(ridbits_fit, RID_LAST_MODIFIER < sizeof(unsigned long) * CHAR_BIT); @@ -259,6 +260,7 @@ static const struct resword reswords[] = { "signed", RID_SIGNED, 0 }, { "sizeof", RID_SIZEOF, 0 }, { "static", RID_STATIC, 0 }, + { "static_assert", RID_STATIC_ASSERT, D_CPP0X }, { "static_cast", RID_STATCAST, 0 }, { "struct", RID_STRUCT, 0 }, { "switch", RID_SWITCH, 0 }, @@ -314,7 +316,8 @@ init_reswords (void) tree id; int mask = ((flag_no_asm ? D_ASM : 0) | D_OBJC - | (flag_no_gnu_keywords ? D_EXT : 0)); + | (flag_no_gnu_keywords ? D_EXT : 0) + | (flag_cpp0x ? 0 : D_CPP0X)); ridpointers = GGC_CNEWVEC (tree, (int) RID_MAX); for (i = 0; i < ARRAY_SIZE (reswords); i++) |