-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
assume()
chneck for clang C++17/C++20 build.
In clang 19, all of a sudden the compile-time feature check for `[[assume()]]` support started issuing a warning: it says that attribute is a "C++23 extension." And the maintainer-mode build treats warnings as wrrors, so... Kaboom. The problem is that in this mode, clang 19 does define the feature test macro for this attribute even in C++ 17, but when you actually _use_ the attribute, clang warns (at least with strict checking options) that it is not part of C++17 (or C++20, as the case may be). To get around that, I wrote a more substantial feature check and ran it at _configure_ time. This is where my work on systematising the feature check mechanism really pays off — a few years ago this would have been a fairly substantial change, with lots of opportunities to do it wrong.
- Loading branch information
Showing
7 changed files
with
56 additions
and
8 deletions.
There are no files selected for viewing
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
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,5 @@ | ||
int main(int argc, char **argv) | ||
{ | ||
[[assume(argv != nullptr)]]; | ||
return argc - 1; | ||
} |
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
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
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
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
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