Open torsten48 opened 4 months ago
@llvm/issue-subscribers-clang-frontend
Author: None (torsten48)
The warning is emitted in the clang driver before the source file is read (i.e., the warning is written to the console before it gets to the pragma), and Clang don't support retroactively removing diagnostics.
Like if you wrote this:
char* p = ""; // Still has a warning
#pragma clang diagnostic ignored "-Wwritable-strings"
Since the pragma directive ignores the warning in the code after it, it doesn't do anything about warnings before it.
Another warning could be added to suggest modifying the command line flags to have -Wno-delayed-template-parsing-in-cxx20
. Or this diagnostic could be emitted at the end of every TU so ignoring it would actually work.
using clang-cl with
/Zc:twoPhase-
and
#pragma clang diagnostic ignored "-Wdelayed-template-parsing-in-cxx20"
but clang-cl still emits
clang-cl: warning: -fdelayed-template-parsing is deprecated after C++20 [-Wdelayed-template-parsing-in-cxx20]
C:\build\clang> clang-cl --version clang version 18.1.6 Target: x86_64-pc-windows-msvc Thread model: posix InstalledDir: c:\devtools\LLVM\bin