PR c/66970 - Add __has_builtin() macro
authorMartin Sebor <msebor@redhat.com>
Mon, 28 Oct 2019 22:46:28 +0000 (22:46 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Mon, 28 Oct 2019 22:46:28 +0000 (16:46 -0600)
commitad1539d5555a161cf6851de8995641d6dfe792d9
treee56e9d15ba5ff4476a38e5269c6163b5dc6a36e9
parent48b2123f6336ba6c06846d7c8b60bd14eaeae7ec
PR c/66970 - Add __has_builtin() macro

gcc/ChangeLog:

PR c/66970
* doc/cpp.texi (__has_builtin): Document.
* doc/extend.texi (__builtin_frob_return_addr): Correct spelling.

gcc/c/ChangeLog:

PR c/66970
* c-decl.c (names_builtin_p): Define a new function.

gcc/c-family/ChangeLog:

PR c/66970
* c-common.c (c_common_nodes_and_builtins): Call c_define_builtins
even when only preprocessing.
* c-common.h (names_builtin_p): Declare new function.
* c-lex.c (init_c_lex): Set has_builtin.
(c_common_has_builtin): Define a new function.
* c-ppoutput.c (init_pp_output): Set has_builtin.

gcc/cp/ChangeLog:

PR c/66970
* cp-objcp-common.c (names_builtin_p): Define new function.

gcc/testsuite/ChangeLog:

PR c/66970
* c-c++-common/cpp/has-builtin-2.c: New test.
* c-c++-common/cpp/has-builtin-3.c: New test.
* c-c++-common/cpp/has-builtin.c: New test.

From-SVN: r277544
20 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c-family/c-lex.c
gcc/c-family/c-ppoutput.c
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/cp/ChangeLog
gcc/cp/cp-objcp-common.c
gcc/doc/cpp.texi
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/cpp/has-builtin-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cpp/has-builtin-3.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cpp/has-builtin.c [new file with mode: 0644]
libcpp/include/cpplib.h
libcpp/init.c
libcpp/macro.c
libcpp/traditional.c