[clang] [analyzer] Suppress optin.cplusplus.VirtualCall warnings in system headers (PR #184183)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 4 03:20:21 PST 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results
* 83565 tests passed
* 1281 tests skipped
* 1 test failed
## Failed Tests
(click on a test name to see its output)
### Clang
<details>
<summary>Clang.Analysis/virtualcall.cpp</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -analyze -setup-static-analyzer -analyzer-checker=core,optin.cplusplus.VirtualCall -analyzer-checker=debug.ExprInspection -std=c++11 -verify=impure /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -analyze -setup-static-analyzer -analyzer-checker=core,optin.cplusplus.VirtualCall -analyzer-checker=debug.ExprInspection -std=c++11 -verify=impure /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp
# note: command had no output on stdout or stderr
# RUN: at line 5
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -analyze -setup-static-analyzer -analyzer-checker=core,cplusplus.PureVirtualCall -analyzer-checker=debug.ExprInspection -std=c++11 -verify=pure -std=c++11 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -analyze -setup-static-analyzer -analyzer-checker=core,cplusplus.PureVirtualCall -analyzer-checker=debug.ExprInspection -std=c++11 -verify=pure -std=c++11 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp
# note: command had no output on stdout or stderr
# RUN: at line 9
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -analyze -setup-static-analyzer -analyzer-checker=core,cplusplus.PureVirtualCall -analyzer-checker=optin.cplusplus.VirtualCall -analyzer-checker=debug.ExprInspection -std=c++11 -verify=pure,impure -std=c++11 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -analyze -setup-static-analyzer -analyzer-checker=core,cplusplus.PureVirtualCall -analyzer-checker=optin.cplusplus.VirtualCall -analyzer-checker=debug.ExprInspection -std=c++11 -verify=pure,impure -std=c++11 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp
# note: command had no output on stdout or stderr
# RUN: at line 15
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -analyze -setup-static-analyzer -analyzer-checker=core,optin.cplusplus.VirtualCall -std=c++11 -verify=system /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -analyze -setup-static-analyzer -analyzer-checker=core,optin.cplusplus.VirtualCall -std=c++11 -verify=system /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp
# .---command stderr------------
# | error: 'system-warning' diagnostics seen but not expected:
# | File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.h Line 5: Call to virtual method 'Z::foo' during construction bypasses virtual dispatch [optin.cplusplus.VirtualCall]
# | File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp Line 45: Call to virtual method 'B::foo' during construction bypasses virtual dispatch [optin.cplusplus.VirtualCall]
# | File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp Line 51: Call to virtual method 'B::foo' during destruction bypasses virtual dispatch [optin.cplusplus.VirtualCall]
# | File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp Line 58: Call to virtual method 'B::foo' during destruction bypasses virtual dispatch [optin.cplusplus.VirtualCall]
# | File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp Line 71: Call to virtual method 'C::foo' during construction bypasses virtual dispatch [optin.cplusplus.VirtualCall]
# | File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp Line 125: Call to virtual method 'H::f' during construction bypasses virtual dispatch [optin.cplusplus.VirtualCall]
# | File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp Line 127: Call to virtual method 'H::f' during construction bypasses virtual dispatch [optin.cplusplus.VirtualCall]
# | File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp Line 134: Call to virtual method 'X::g' during construction bypasses virtual dispatch [optin.cplusplus.VirtualCall]
# | File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp Line 141: Call to virtual method 'X::g' during construction bypasses virtual dispatch [optin.cplusplus.VirtualCall]
# | File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp Line 162: Call to virtual method 'M::foo' during construction bypasses virtual dispatch [optin.cplusplus.VirtualCall]
# | File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Analysis/virtualcall.cpp Line 170: Call to virtual method 'Y::foobar' during construction bypasses virtual dispatch [optin.cplusplus.VirtualCall]
# | 11 errors generated.
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.
https://github.com/llvm/llvm-project/pull/184183
More information about the cfe-commits
mailing list