1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
3 namespace [[clang::suppress
]]
13 int suppressed_namespace::foo_forward() {
15 return *x
; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}}
18 // Another instance of the same namespace.
19 namespace suppressed_namespace
{
22 return *x
; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}}
35 class [[clang::suppress
]] SuppressedClass
{
44 int SuppressedClass::bar() {
46 return *x
; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}}
49 class SuppressedMethodClass
{
50 [[clang::suppress
]] int foo() {
55 [[clang::suppress
]] int bar1();
59 int SuppressedMethodClass::bar1() {
61 return *x
; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}}
65 int SuppressedMethodClass::bar2() {
67 return *x
; // no-warning