]> granicus.if.org Git - clang/commit
[Sema] Improve redefinition errors pointing to the same header
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 11 May 2017 06:20:07 +0000 (06:20 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 11 May 2017 06:20:07 +0000 (06:20 +0000)
commitffeec21d4455a1f5fb5b2f85120dc14accd76125
tree3a58cbe45981a7e0ed2f06165bf02fee60bb781c
parent5591bb23a469c5002ede29496ed289491f4b9859
[Sema] Improve redefinition errors pointing to the same header

Diagnostics related to redefinition errors that point to the same header
file do not provide much information that helps users fixing the issue.

- In the modules context, it usually happens because of non modular
includes.
- When modules aren't involved it might happen because of the lack of
header guards.

Enhance diagnostics in these scenarios.

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

rdar://problem/31669175

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302765 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/Sema/SemaDecl.cpp
test/Modules/Inputs/SameHeader/A.h [new file with mode: 0644]
test/Modules/Inputs/SameHeader/B.h [new file with mode: 0644]
test/Modules/Inputs/SameHeader/C.h [new file with mode: 0644]
test/Modules/Inputs/SameHeader/module.modulemap [new file with mode: 0644]
test/Modules/redefinition-same-header.m [new file with mode: 0644]
test/Sema/redefinition-same-header.c [new file with mode: 0644]
test/SemaCXX/modules-ts.cppm