diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-12-21 17:54:25 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@codesourcery.com> | 2004-12-21 17:54:25 +0000 |
commit | 41c39a1afe1710ee108d187a132448b38f08e82e (patch) | |
tree | f5295c69fc8f09f127b9123926fef7ac163cb383 /gcc/cp/cp-tree.h | |
parent | 0c2302231034571ad6cec580ecf235f911fd8a14 (diff) |
cp:
PR c++/14075
* decl.c (check_initializer): Check string initializer of array is
not parenthesized.
* cp-tree.h (PAREN_STRING_LITERAL_P): New.
* semantics.c (finish_parenthesized_expr): Mark a STRING_CST.
* error.c (dump_expr): <STRING_CST case> Add parens, if needed.
testsuite:
PR c++/14075
* g++.dg/init/string1.C: New.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@92464 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 82cd13f418f..c6d47c909f4 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -42,6 +42,7 @@ struct diagnostic_context; CLEANUP_P (in TRY_BLOCK) AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR) PTRMEM_OK_P (in ADDR_EXPR, OFFSET_REF) + PAREN_STRING_LITERAL (in STRING_CST) DECL_PRETTY_FUNCTION_P (in VAR_DECL) KOENIG_LOOKUP_P (in CALL_EXPR) STATEMENT_LIST_NO_SCOPE (in STATEMENT_LIST). @@ -2248,6 +2249,12 @@ struct lang_decl GTY(()) should be performed at instantiation time. */ #define KOENIG_LOOKUP_P(NODE) TREE_LANG_FLAG_0 (CALL_EXPR_CHECK (NODE)) +/* Indicates whether a string literal has been parenthesized. Such + usages are disallowed in certain circumstances. */ + +#define PAREN_STRING_LITERAL_P(NODE) \ + TREE_LANG_FLAG_0 (STRING_CST_CHECK (NODE)) + /* Nonzero if this AGGR_INIT_EXPR provides for initialization via a constructor call, rather than an ordinary function call. */ #define AGGR_INIT_VIA_CTOR_P(NODE) \ |