-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
toolchain: add patch to fix cpp in gcc-10
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
tools/toolchain/scripts/files/gcc-10.2.0-cpp-__has_include.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From b7bb13d4a5fcb593dc745ca3b6180f8babb54893 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Tiziano=20M=C3=BCller?= <tiziano.mueller@chem.uzh.ch> | ||
Date: Mon, 27 Jul 2020 15:40:38 +0200 | ||
Subject: [PATCH] libcpp: fix __has_include handling with traditional-cpp | ||
|
||
fixes #95889 | ||
--- | ||
libcpp/init.c | 3 +++ | ||
libcpp/traditional.c | 4 +++- | ||
2 files changed, 6 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/libcpp/init.c b/libcpp/init.c | ||
index 0aac5acd0a35..b0cf71192589 100644 | ||
--- a/libcpp/init.c | ||
+++ b/libcpp/init.c | ||
@@ -400,6 +400,9 @@ static const struct builtin_macro builtin_array[] = | ||
B("__LINE__", BT_SPECLINE, true), | ||
B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL, true), | ||
B("__COUNTER__", BT_COUNTER, true), | ||
+ /* Make sure to update the list of built-in | ||
+ function-like macros in traditional.c: | ||
+ fun_like_macro() when adding more following */ | ||
B("__has_attribute", BT_HAS_ATTRIBUTE, true), | ||
B("__has_cpp_attribute", BT_HAS_ATTRIBUTE, true), | ||
B("__has_builtin", BT_HAS_BUILTIN, true), | ||
diff --git a/libcpp/traditional.c b/libcpp/traditional.c | ||
index 77adb3bf595f..b087072c9b4c 100644 | ||
--- a/libcpp/traditional.c | ||
+++ b/libcpp/traditional.c | ||
@@ -330,7 +330,9 @@ fun_like_macro (cpp_hashnode *node) | ||
{ | ||
if (cpp_builtin_macro_p (node)) | ||
return (node->value.builtin == BT_HAS_ATTRIBUTE | ||
- || node->value.builtin == BT_HAS_BUILTIN); | ||
+ || node->value.builtin == BT_HAS_BUILTIN | ||
+ || node->value.builtin == BT_HAS_INCLUDE | ||
+ || node->value.builtin == BT_HAS_INCLUDE_NEXT); | ||
return node->value.macro->fun_like; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters