summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorConstantin Kronbichler <56307024+ccrownhill@users.noreply.github.com>2024-07-11 17:35:48 +0100
committerGitHub <noreply@github.com>2024-07-11 12:35:48 -0400
commite16882fc7416a30d56d5b5a19d549ca7c653e668 (patch)
tree4ff114add9506b4823249e733fb58865072781d2 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent9ddfe62f5c11e3f65f444209f514029ded2d58b9 (diff)
fix bug that undefined internal is a warning only for -pedantic-errors (#98016)
This fixes issue #39558 which mentions the problem when compiling the following code with `-pedantic-errors` flag (it also mentions `-Wall -Wextra` but those shouldn't change the output, which is also the case in GCC): ```c static void f(); int main() { f; } ``` Clang only outputs an `undefined-internal` warning on the first line, but according to 6.9/3 ``` "... Moreover, if an identifier declared with internal linkage is used in an expression (other than as a part of the operand of a sizeof or _Alignof operator whose result is an integer constant), there shall be exactly one external definition for the identifier in the translation unit." ``` this should be illegal and hence an error. I fixed this by changing the warning type from `Warning` to `ExtWarn` and by adding a suitable test.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions