]> granicus.if.org Git - clang/commit
Introducing -Wheader-guard, a warning that checks header guards actually work
authorRichard Trieu <rtrieu@google.com>
Wed, 12 Jun 2013 21:20:57 +0000 (21:20 +0000)
committerRichard Trieu <rtrieu@google.com>
Wed, 12 Jun 2013 21:20:57 +0000 (21:20 +0000)
commit671538e8a51eab5bd65a1f9f327ba7f44f84e486
tree3ac9cce6abe8b25d0db14b313c6b17b5549256f8
parenta603569515eea06e54e6e041b1c690d33086f375
Introducing -Wheader-guard, a warning that checks header guards actually work
properly.  This warning checks that the #ifndef and #define directives at
the beginning of a header refer to the same macro name.  Includes a fix-it
hint to correct the header guard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183867 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/clang/Basic/DiagnosticLexKinds.td
include/clang/Lex/HeaderSearch.h
include/clang/Lex/MultipleIncludeOpt.h
include/clang/Lex/Preprocessor.h
lib/Lex/PPDirectives.cpp
lib/Lex/PPLexerChange.cpp
test/Lexer/Inputs/bad-header-guard.h [new file with mode: 0644]
test/Lexer/Inputs/different-define.h [new file with mode: 0644]
test/Lexer/Inputs/good-header-guard.h [new file with mode: 0644]
test/Lexer/Inputs/multiple.h [new file with mode: 0644]
test/Lexer/Inputs/no-define.h [new file with mode: 0644]
test/Lexer/Inputs/out-of-order-define.h [new file with mode: 0644]
test/Lexer/Inputs/tokens-between-ifndef-and-define.h [new file with mode: 0644]
test/Lexer/header.cpp [new file with mode: 0644]