llvm-project/clang/lib/Sema
David Blaikie ae12b18ad8 Suppress macro expansion of NULL in NULL warnings.
For "int i = NULL;" we would produce:

null.cpp:5:11: warning: implicit conversion of NULL constant to integer [-Wconversion]
  int i = NULL;
      ~   ^~~~
null.cpp:1:14: note: expanded from macro 'NULL'
\#define NULL __null
              ^~~~~~

But we really shouldn't trace that macro expansion back into the header, yet we
still want macro back traces for code like this:

\#define FOO NULL
int i = FOO;

or

\#define FOO int i = NULL;
FOO

While providing appropriate tagging at different levels of the expansion, etc.

The included test case exercises these cases & does some basic validation (to
ensure we don't have macro expansion notes where we shouldn't, and do where we
should) - but doesn't go as far as to validate the source location/ranges
used in those notes and warnings.

llvm-svn: 152940
2012-03-16 20:30:12 +00:00
..
AnalysisBasedWarnings.cpp improve on diagnostic and provide a fixit hint when 2012-03-08 00:22:50 +00:00
AttributeList.cpp Refactor Clang sema attribute handling. 2012-03-07 00:12:16 +00:00
CMakeLists.txt Refactor Clang sema attribute handling. 2012-03-07 00:12:16 +00:00
CodeCompleteConsumer.cpp Basic: import SmallString<> into clang namespace 2012-02-05 02:13:05 +00:00
DeclSpec.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
DelayedDiagnostic.cpp objc: When issue diagnostic about deprecated method, also 2012-03-02 21:50:02 +00:00
IdentifierResolver.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
JumpDiagnostics.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
Makefile BUILD_ARCHIVE is the default for libraries, no need to set it. 2010-07-18 00:14:47 +00:00
Scope.cpp Reapply r151638 and r151641. 2012-02-29 10:24:19 +00:00
Sema.cpp [Sema] Fix SemaDiagnosticBuilder to be inline. 2012-03-14 09:49:32 +00:00
SemaAccess.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaAttr.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaCXXScopeSpec.cpp Instantiating a class template should not instantiate the definition of any 2012-03-14 23:13:10 +00:00
SemaCast.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaChecking.cpp Suppress macro expansion of NULL in NULL warnings. 2012-03-16 20:30:12 +00:00
SemaCodeComplete.cpp [Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() iterators instead of 2012-03-13 01:09:41 +00:00
SemaConsumer.cpp Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:48:34 +00:00
SemaDecl.cpp Warn on flexible array members when in C89 mode, with -pedantic. 2012-03-16 12:15:37 +00:00
SemaDeclAttr.cpp Minor cleanup in attribute-related diagnostics, from Alexander Kornienko! 2012-03-14 16:55:17 +00:00
SemaDeclCXX.cpp Skip through transparent contexts when deciding where to add a friend function. 2012-03-16 19:51:19 +00:00
SemaDeclObjC.cpp Fix PR10447: lazily building name lookup tables for DeclContexts was broken. 2012-03-13 03:12:56 +00:00
SemaExceptionSpec.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaExpr.cpp Alternate fix to PR12248: put Sema in charge of special-casing 2012-03-13 00:37:01 +00:00
SemaExprCXX.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaExprMember.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaExprObjC.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaFixItUtils.cpp Refactor for clarity. 2012-01-13 19:34:55 +00:00
SemaInit.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaLambda.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaLookup.cpp It never makes sense to do a lookup into a LinkageSpecDecl, so assert that we 2012-03-13 04:12:34 +00:00
SemaObjCProperty.cpp Fix PR10447: lazily building name lookup tables for DeclContexts was broken. 2012-03-13 03:12:56 +00:00
SemaOverload.cpp When emitting a diagnostic about two-phase name lookup, don't do useless 2012-03-14 20:41:00 +00:00
SemaPseudoObject.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaStmt.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaTemplate.cpp Implement [temp.param]p5: the top-level cv-qualifiers on a non-type template 2012-03-13 07:21:50 +00:00
SemaTemplateDeduction.cpp Support deducing template arguments from nested initializer lists. PR12119. 2012-03-15 21:40:51 +00:00
SemaTemplateInstantiate.cpp Instantiating a class template should not instantiate the definition of any 2012-03-14 23:13:10 +00:00
SemaTemplateInstantiateDecl.cpp Instantiating a class template should not instantiate the definition of any 2012-03-14 23:13:10 +00:00
SemaTemplateVariadic.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
SemaType.cpp Fix parsing of trailing-return-type. Types are syntactically prohibited from 2012-03-12 08:56:40 +00:00
TargetAttributesSema.cpp Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST). 2012-03-11 07:00:24 +00:00
TargetAttributesSema.h Remove Sema.h's dependency on DeclCXX.h. 2010-08-25 07:42:41 +00:00
TreeTransform.h ObjCBoolLiterals (__objc_yes/__objc_no) behave like C++ booleans (true/false). They are NOT objects. 2012-03-12 17:53:02 +00:00
TypeLocBuilder.h Remove more unnecessary #include <llvm/ADT/SmallVector.h> 2011-06-20 06:11:46 +00:00