Bug 274484
| Summary: | REGRESSION(279061@main): [clang 18] error: 'suppress' attribute only applies to variables and statements | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Fujii Hironori <fujii.hironori> |
| Component: | Web Template Framework | Assignee: | Fujii Hironori <fujii.hironori> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | rniwa, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Fujii Hironori
After 279061@main (bug#274434), Windows port can't compile.
C:\PROGRA~1\LLVM\bin\clang-cl.exe /nologo -TP [...] -c -- C:\ews\work\build\Source\WTF\wtf\BloomFilter.cpp
In file included from C:\ews\work\build\Source\WTF\wtf\BloomFilter.cpp:27:
In file included from C:\ews\work\build\Source\WTF\wtf/BloomFilter.h:29:
In file included from C:\ews\work\build\Source\WTF\wtf/text/AtomString.h:24:
In file included from C:\ews\work\build\Source\WTF\wtf/text/AtomStringImpl.h:23:
C:\ews\work\build\Source\WTF\wtf/text/UniquedStringImpl.h(34,7): error: 'suppress' attribute only applies to variables and statements
34 | class SUPPRESS_REFCOUNTED_WITHOUT_VIRTUAL_DESTRUCTOR UniquedStringImpl : public StringImpl {
| ^
C:\ews\work\build\Source\WTF\wtf/Compiler.h(512,5): note: expanded from macro 'SUPPRESS_REFCOUNTED_WITHOUT_VIRTUAL_DESTRUCTOR'
512 | IGNORE_CLANG_STATIC_ANALYZER_WARNINGS_ATTRIBUTE("webkit.RefCntblBaseVirtualDtor")
| ^
C:\ews\work\build\Source\WTF\wtf/Compiler.h(470,73): note: expanded from macro 'IGNORE_CLANG_STATIC_ANALYZER_WARNINGS_ATTRIBUTE'
470 | #define IGNORE_CLANG_STATIC_ANALYZER_WARNINGS_ATTRIBUTE(warning, ...) [[clang::suppress]]
| ^
In file included from C:\ews\work\build\Source\WTF\wtf\BloomFilter.cpp:27:
In file included from C:\ews\work\build\Source\WTF\wtf/BloomFilter.h:29:
In file included from C:\ews\work\build\Source\WTF\wtf/text/AtomString.h:24:
C:\ews\work\build\Source\WTF\wtf/text/AtomStringImpl.h(29,7): error: 'suppress' attribute only applies to variables and statements
29 | class SUPPRESS_REFCOUNTED_WITHOUT_VIRTUAL_DESTRUCTOR AtomStringImpl final : public UniquedStringImpl {
| ^
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Fujii Hironori
Surprisingly, WinCairo EWS and post-commit buildbot don't complain.
compiler version? I'm using clang-cl version 18.1.4.
Ryosuke Niwa
Sounds like we need to disable this static analyzer feature on Windows then.
Fujii Hironori
I think this can happen on Linux.
This seems to be a problem for clang 18.0.1.
https://godbolt.org/z/6fcKfWh7d
clang 17.0.1
> <source>:1:9: warning: unknown attribute 'suppress' ignored [-Wunknown-attributes]
clang 18.0.1
> <source>:1:9: error: 'suppress' attribute only applies to variables and statements
Fujii Hironori
I took the example code from clang 19 document.
clang 18 document doen't have the code.
It seems to be a clang 19 feature.
https://clang.llvm.org/docs/AttributeReference.html#suppress
https://web.archive.org/web/20231127125017/https://clang.llvm.org/docs/AttributeReference.html#suppress
Fujii Hironori
Pull request: https://github.com/WebKit/WebKit/pull/28892
EWS
Committed 279094@main (c42264fb3ebd): <https://commits.webkit.org/279094@main>
Reviewed commits have been landed. Closing PR #28892 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/128508606>