llvm-project/clang/lib/Sema
Matt Davis 9cc6bba52c [Diag] Avoid emitting a redefinition note if no location is available.
Summary:
The "previous definition is here" note is not helpful if there is no location information. The note will reference nothing in such a case. This patch first checks to see if there is location data, and if so the note diagnostic is emitted.

This fixes PR15409.  The issue in the first comment seems to already be resolved. This patch addresses the second example.

Reviewers: bruno, rsmith

Reviewed By: bruno

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D44901

llvm-svn: 328712
2018-03-28 16:05:05 +00:00
..
AnalysisBasedWarnings.cpp Fix some handling of AST nodes with diagnostics. 2018-03-28 04:16:13 +00:00
AttributeList.cpp [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-02-20 02:16:28 +00:00
CMakeLists.txt Enabling the /bigobj flag for SemaDeclAttr.cpp. 2017-05-12 14:30:49 +00:00
CodeCompleteConsumer.cpp [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-02-20 02:16:28 +00:00
CoroutineStmtBuilder.h [coroutines] Pass coro func args to promise ctor 2018-01-24 22:15:42 +00:00
DeclSpec.cpp Again reverting an attempt to convert the DeclSpec enums into scoped enums. 2018-01-01 18:23:28 +00:00
DelayedDiagnostic.cpp [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-02-21 01:45:26 +00:00
IdentifierResolver.cpp [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-02-21 01:45:26 +00:00
JumpDiagnostics.cpp [ObjC] Allow declaring __strong pointer fields in structs in Objective-C 2018-02-28 07:15:55 +00:00
MultiplexExternalSemaSource.cpp [modules] Correctly overload getModule in the MultiplexExternalSemaSource 2018-01-22 15:27:25 +00:00
Scope.cpp Fix Scope::dump() 2018-01-18 04:28:56 +00:00
ScopeInfo.cpp [coroutines] Pass coro func args to promise ctor 2018-01-24 22:15:42 +00:00
Sema.cpp [MS] Fix late-parsed template infinite loop in eager instantiation 2018-03-26 18:22:47 +00:00
SemaAccess.cpp Revert r325321 "[Sema] Take into account the current context when checking the" 2018-02-16 12:06:32 +00:00
SemaAttr.cpp -Wpragma-pack: add an additional note and fixit when warning 2017-07-31 13:37:50 +00:00
SemaCUDA.cpp Fix some handling of AST nodes with diagnostics. 2018-03-28 04:16:13 +00:00
SemaCXXScopeSpec.cpp Add support for editor placeholders to Clang 2017-04-19 08:58:56 +00:00
SemaCast.cpp Allow the target field of a CK_ToUnion to be more easily recovered. 2017-08-15 21:42:47 +00:00
SemaChecking.cpp Fix some handling of AST nodes with diagnostics. 2018-03-28 04:16:13 +00:00
SemaCodeComplete.cpp Remove redundant casts. NFC 2018-03-01 05:43:23 +00:00
SemaConsumer.cpp
SemaCoroutine.cpp [coroutines] Do not attempt to typo-correct when coroutine is looking for required members 2018-03-27 20:38:19 +00:00
SemaDecl.cpp [Diag] Avoid emitting a redefinition note if no location is available. 2018-03-28 16:05:05 +00:00
SemaDeclAttr.cpp [clang] Change std::sort to llvm::sort in response to r327219 2018-03-27 16:50:00 +00:00
SemaDeclCXX.cpp Fix some handling of AST nodes with diagnostics. 2018-03-28 04:16:13 +00:00
SemaDeclObjC.cpp Remove redundant casts. NFC 2018-03-01 05:43:23 +00:00
SemaExceptionSpec.cpp Remove redundant casts. NFC 2018-03-01 05:43:23 +00:00
SemaExpr.cpp Fix some handling of AST nodes with diagnostics. 2018-03-28 04:16:13 +00:00
SemaExprCXX.cpp [ObjC] Make C++ triviality type traits available to non-trivial C 2018-03-28 00:12:08 +00:00
SemaExprMember.cpp [Sema] Avoid crash for category implementation without interface 2018-03-27 18:58:28 +00:00
SemaExprObjC.cpp Add an option to disable tail-call optimization for escaping blocks. 2018-03-02 01:53:15 +00:00
SemaFixItUtils.cpp Wire a SourceLocation into IsDerivedFrom and move the RequireCompleteType call 2015-12-18 21:45:41 +00:00
SemaInit.cpp PR36055: fix computation of *-dependence in nested initializer lists. 2018-02-07 22:25:16 +00:00
SemaLambda.cpp [SemaCXX] _Pragma("clang optimize off") not affecting lambda. 2018-03-26 13:48:03 +00:00
SemaLookup.cpp [clang] Change std::sort to llvm::sort in response to r327219 2018-03-27 16:50:00 +00:00
SemaObjCProperty.cpp Remove redundant casts. NFC 2018-03-01 05:43:23 +00:00
SemaOpenMP.cpp [OPENMP] Codegen for declare target with link clause. 2018-03-26 16:40:55 +00:00
SemaOverload.cpp [clang] Change std::sort to llvm::sort in response to r327219 2018-03-27 16:50:00 +00:00
SemaPseudoObject.cpp [CodeGen] Ignore OpaqueValueExprs that are unique references to their 2018-03-20 01:47:58 +00:00
SemaStmt.cpp Refactoring code around move/copy initialization. NFC. 2018-03-15 03:00:55 +00:00
SemaStmtAsm.cpp Re-land "[Sema] Make getCurFunction() return null outside function parsing" 2018-03-12 21:43:02 +00:00
SemaStmtAttr.cpp Now that C++17 is official (https://www.iso.org/standard/68564.html), start changing the C++1z terminology over to C++17. NFC intended, these are all mechanical changes. 2017-12-04 20:27:34 +00:00
SemaTemplate.cpp Implement C++ DR727, which permits explicit specializations at class scope. 2018-03-16 13:36:56 +00:00
SemaTemplateDeduction.cpp [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-02-22 22:35:17 +00:00
SemaTemplateInstantiate.cpp Sink PrettyDeclStackTrace down to the AST library 2018-03-23 00:07:18 +00:00
SemaTemplateInstantiateDecl.cpp [MS] Fix late-parsed template infinite loop in eager instantiation 2018-03-26 18:22:47 +00:00
SemaTemplateVariadic.cpp Fix crash when trying to pack-expand a GNU statement expression. 2018-02-03 00:44:57 +00:00
SemaType.cpp [clang] Change std::sort to llvm::sort in response to r327219 2018-03-27 16:50:00 +00:00
TreeTransform.h Fix some handling of AST nodes with diagnostics. 2018-03-28 04:16:13 +00:00
TypeLocBuilder.cpp [Sema] Fix bug in TypeLocBuilder::pushImpl 2016-02-18 21:05:09 +00:00
TypeLocBuilder.h Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00