teak-llvm/clang/test/SemaCXX/Inputs/warn-unused-variables.h
Eli Friedman 5ef2175866 Make -Wunused warning rules more consistent.
This patch does a few different things.

This patch improves unused var diags for const vars: we no longer
unconditionally suppress diagnostics for const vars, instead only suppressing
the diagnostic when the declaration appears to be useful.

This patch also makes us more consistently use whether a variable/function
is declared in the main file to suppress diagnostics where appropriate.

Fixes <rdar://problem/14907887>.

llvm-svn: 190382
2013-09-10 03:05:56 +00:00

14 lines
242 B
C++

// Verify that we don't warn about variables of internal-linkage type in
// headers, as the use may be in another TU.
namespace PR15558 {
namespace {
class A {};
}
class B {
static A a;
static A b;
static const int x = sizeof(b);
};
}