diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-19 12:20:58 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-19 12:20:58 +0000 |
commit | 33058239ca52559e37bb4e0dd1214fb37464929a (patch) | |
tree | c196a5cfa64d537aa3ba5756e62095791c4f3ca3 /libcpp/expr.c | |
parent | 58439d80f1cca7a11af69e8fe825a5b828a8d9bf (diff) | |
download | gcc-33058239ca52559e37bb4e0dd1214fb37464929a.tar.gz |
PR preprocessor/63831
* c-cppbuiltin.c (c_cpp_builtins): Don't define __has_attribute
and __has_cpp_attribute here.
* c-ppoutput.c (init_pp_output): Set cb->has_attribute to
c_common_has_attribute.
* c-common.h (c_common_has_attribute): New prototype.
* c-lex.c (init_c_lex): Set cb->has_attribute to
c_common_has_attribute instead of cb_has_attribute.
(get_token_no_padding): New function.
(cb_has_attribute): Renamed to ...
(c_common_has_attribute): ... this. No longer static. Use
get_token_no_padding, require ()s, don't build TREE_LIST
unnecessarily, fix up formatting, adjust diagnostics, call
init_attributes.
* directives.c (lex_macro_node): Remove __has_attribute__ handling.
* internal.h (struct spec_node): Remove n__has_attribute__ field.
(struct lexer_state): Remove in__has_attribute__ field.
* macro.c (_cpp_builtin_macro_text): Handle BT_HAS_ATTRIBUTE.
* identifiers.c (_cpp_init_hashtable): Remove __has_attribute__
handling.
* init.c (builtin_array): Add __has_attribute and __has_cpp_attribute.
(cpp_init_special_builtins): Don't initialize __has_attribute
or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL.
* traditional.c (enum ls): Remove ls_has_attribute,
ls_has_attribute_close.
(_cpp_scan_out_logical_line): Remove __has_attribute__ handling.
* include/cpplib.h (enum cpp_builtin_type): Add BT_HAS_ATTRIBUTE.
* pch.c (cpp_read_state): Remove __has_attribute__ handling.
* expr.c (eval_token): Likewise.
(parse_has_attribute): Removed.
* c-c++-common/cpp/pr63831-1.c: New test.
* c-c++-common/cpp/pr63831-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218948 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/expr.c')
-rw-r--r-- | libcpp/expr.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/libcpp/expr.c b/libcpp/expr.c index 529709c8560..c24b640ba16 100644 --- a/libcpp/expr.c +++ b/libcpp/expr.c @@ -65,7 +65,6 @@ static unsigned int interpret_int_suffix (cpp_reader *, const uchar *, size_t); static void check_promotion (cpp_reader *, const struct op *); static cpp_num parse_has_include (cpp_reader *, enum include_type); -static cpp_num parse_has_attribute (cpp_reader *); /* Token type abuse to create unary plus and minus operators. */ #define CPP_UPLUS ((enum cpp_ttype) (CPP_LAST_CPP_OP + 1)) @@ -1055,8 +1054,6 @@ eval_token (cpp_reader *pfile, const cpp_token *token, return parse_has_include (pfile, IT_INCLUDE); else if (token->val.node.node == pfile->spec_nodes.n__has_include_next__) return parse_has_include (pfile, IT_INCLUDE_NEXT); - else if (token->val.node.node == pfile->spec_nodes.n__has_attribute__) - return parse_has_attribute (pfile); else if (CPP_OPTION (pfile, cplusplus) && (token->val.node.node == pfile->spec_nodes.n_true || token->val.node.node == pfile->spec_nodes.n_false)) @@ -2150,21 +2147,3 @@ parse_has_include (cpp_reader *pfile, enum include_type type) return result; } - -/* Handle meeting "__has_attribute__" in a preprocessor expression. */ -static cpp_num -parse_has_attribute (cpp_reader *pfile) -{ - pfile->state.in__has_attribute__++; - - cpp_num result; - result.unsignedp = false; - result.high = 0; - result.overflow = false; - - result.low = pfile->cb.has_attribute (pfile); - - pfile->state.in__has_attribute__--; - - return result; -} |