diff options
author | Douglas Gregor <doug.gregor@gmail.com> | 2006-11-21 20:23:03 +0000 |
---|---|---|
committer | Doug Gregor <dgregor@gcc.gnu.org> | 2006-11-21 20:23:03 +0000 |
commit | 55a3debe44095349b898ca6e297b0ecb9f9d16b6 (patch) | |
tree | b93947409f894b645ef269b5199ac8efb6894453 /gcc/cp/cp-tree.def | |
parent | 218f00156cf583db14b1398ca52da12f59383fb3 (diff) | |
download | gcc-55a3debe44095349b898ca6e297b0ecb9f9d16b6.zip gcc-55a3debe44095349b898ca6e297b0ecb9f9d16b6.tar.gz gcc-55a3debe44095349b898ca6e297b0ecb9f9d16b6.tar.bz2 |
cp-tree.def (STATIC_ASSERT): New.
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.
From-SVN: r119066
Diffstat (limited to 'gcc/cp/cp-tree.def')
-rw-r--r-- | gcc/cp/cp-tree.def | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def index 55ef21e..090f91f 100644 --- a/gcc/cp/cp-tree.def +++ b/gcc/cp/cp-tree.def @@ -342,6 +342,14 @@ DEFTREECODE (STMT_EXPR, "stmt_expr", tcc_expression, 1) is applied. */ DEFTREECODE (UNARY_PLUS_EXPR, "unary_plus_expr", tcc_unary, 1) +/** C++0x extensions. */ + +/* A static assertion. This is a C++0x extension. + STATIC_ASSERT_CONDITION contains the condition that is being + checked. STATIC_ASSERT_MESSAGE contains the message (a string + literal) to be displayed if the condition fails to hold. */ +DEFTREECODE (STATIC_ASSERT, "static_assert", tcc_exceptional, 0) + /* Local variables: mode:c |