Sema: do not warn about unused const vars if main file is a header
authorErik Verbruggen <erikjv@me.com>
Fri, 28 Oct 2016 08:28:42 +0000 (08:28 +0000)
committerErik Verbruggen <erikjv@me.com>
Fri, 28 Oct 2016 08:28:42 +0000 (08:28 +0000)
commit89aa7eb2ab30118dfd9c8bf5b2398cd4bc70d53e
treecf1cec7cd50488db1c818cebd32ce634a26a4a9c
parent984f42eed5252a487ac274e16ffcb7c48d9032f5
Sema: do not warn about unused const vars if main file is a header

If we pass a header to libclang, e.g. because it's open in an editor in
an IDE, warnings about unused const vars are not useful: other files
that include the header might use those constants. So when -x *-header
is passed as command-line option, suppress this warning.

llvm-svn: 285386
clang/lib/Sema/Sema.cpp
clang/test/Sema/no-warn-unused-const-variables.c [new file with mode: 0644]