-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly diagnose constant evaluation issues at TU scope
We were not creating an evaluation context for the TU scope, so we never popped an evaluation context for it. Popping the evaluation context triggers a number of diagnostics, including warnings about immediate invocations that we were previously missing. Note: I think we have an additional issue that we should solve, but not as part of this patch. I don't think Clang is properly modeling static initialization as happening before constant expression evaluation. I think structure members members are zero initialized per http://eel.is/c++draft/basic.start.static#1, https://eel.is/c++draft/basic.start.static#2.sentence-2, and http://eel.is/c++draft/dcl.init#general-6.2 and the new test case actually should be accepted. However, it's also worth noting that other compilers behave the way this patch makes Clang behave: https://godbolt.org/z/T7noqhdPr
- Loading branch information
1 parent
5b7941a
commit 1c55f05
Showing
4 changed files
with
28 additions
and
0 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
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