diff options
author | Alex Lorenz <arphaman@gmail.com> | 2016-11-02 15:46:34 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2016-11-02 15:46:34 +0000 |
commit | 560ae565e9fa981ce2a49282b71c1e716ff347d1 (patch) | |
tree | e84aeceba2a821f6f863609ac9dd5307da27cb57 /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | 93f2f7fb6c323083ec39abc0b67a9b51dc416684 (diff) | |
download | bcm5719-llvm-560ae565e9fa981ce2a49282b71c1e716ff347d1.tar.gz bcm5719-llvm-560ae565e9fa981ce2a49282b71c1e716ff347d1.zip |
Add a note that points to the linkage specifier for the C++ linkage errors
This commit improves the "must have C++ linkage" error diagnostics that are
emitted for C++ declarations like templates and literal operators by adding an
additional note that points to the appropriate extern "C" linkage specifier.
rdar://19021120
Differential Revision: https://reviews.llvm.org/D26189
llvm-svn: 285823
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 17d1978de03..fb3b7373978 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -12757,6 +12757,9 @@ bool Sema::CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl) { if (FnDecl->isExternC()) { Diag(FnDecl->getLocation(), diag::err_literal_operator_extern_c); + if (const LinkageSpecDecl *LSD = + FnDecl->getDeclContext()->getExternCContext()) + Diag(LSD->getExternLoc(), diag::note_extern_c_begins_here); return true; } |