diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-12-19 13:20:58 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-12-19 13:20:58 +0100 |
commit | 1f8d3e84eee6918f3be3e12be67b250840750aeb (patch) | |
tree | c196a5cfa64d537aa3ba5756e62095791c4f3ca3 /gcc/c-family/c-cppbuiltin.c | |
parent | 8a386c911324b0fdb2a16c14f1420ad0e72540d4 (diff) | |
download | gcc-1f8d3e84eee6918f3be3e12be67b250840750aeb.zip gcc-1f8d3e84eee6918f3be3e12be67b250840750aeb.tar.gz gcc-1f8d3e84eee6918f3be3e12be67b250840750aeb.tar.bz2 |
re PR preprocessor/63831 (r217292 causes segfaults with -MM)
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.
From-SVN: r218948
Diffstat (limited to 'gcc/c-family/c-cppbuiltin.c')
-rw-r--r-- | gcc/c-family/c-cppbuiltin.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index 2dfecb6..057776f 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -800,11 +800,6 @@ c_cpp_builtins (cpp_reader *pfile) cpp_define (pfile, "__has_include(STR)=__has_include__(STR)"); cpp_define (pfile, "__has_include_next(STR)=__has_include_next__(STR)"); - /* Set attribute test macros for all C/C++ (not for just C++11 etc.) - The builtin __has_attribute__ is defined in libcpp. */ - cpp_define (pfile, "__has_attribute(STR)=__has_attribute__(STR)"); - cpp_define (pfile, "__has_cpp_attribute(STR)=__has_attribute__(STR)"); - if (c_dialect_cxx ()) { if (flag_weak && SUPPORTS_ONE_ONLY) |