]> granicus.if.org Git - clang/commit
[Diag] Avoid emitting a redefinition note if no location is available.
authorMatt Davis <Matthew.Davis@sony.com>
Wed, 28 Mar 2018 16:05:05 +0000 (16:05 +0000)
committerMatt Davis <Matthew.Davis@sony.com>
Wed, 28 Mar 2018 16:05:05 +0000 (16:05 +0000)
commitd36734b4d8d81d24340039b5744d13d41ff207de
treef8c760fbc43e335485e6c9312d8da71fee7de31b
parente34c81ff7cb711a982153031374db42632435b92
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328712 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
test/Sema/redefine_extname.c