[LLVMbugs] [Bug 22481] clang-tidy: add Clang -Wignored-qualifiers

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 12 16:25:04 PST 2015


Alexander Kornienko <alexfh at google.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #1 from Alexander Kornienko <alexfh at google.com> ---
Clang-tidy can run any Clang diagnostic and apply suggested fixes if the
diagnostic produces them. The -Wignored-qualifiers can produce fixes, you can
use it in clang-tidy like this:

$ cat q.cc
const int f() { return 42; }
$ clang-tidy -extra-arg=-Wignored-qualifiers -fix q.cc --
1 warning generated.
q.cc:1:1: warning: 'const' type qualifier on return type has no effect
const int f() { return 42; }
q.cc:1:1: note: FIX-IT applied suggested code changes
const int f() { return 42; }
clang-tidy applied 1 of 1 suggested fixes.
$ cat q.cc
int f() { return 42; }

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150213/2809db11/attachment.html>

More information about the llvm-bugs mailing list