diff options
author | Hans Wennborg <hans@hanshq.net> | 2015-02-21 01:07:24 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2015-02-21 01:07:24 +0000 |
commit | 5870373d19547b3e05bc1ec1df3b534d999e1d82 (patch) | |
tree | dcea477a08b884e3529ff2aedc2e60dd8bb4db81 /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | 2e5c25ac772412310509c0b44ce7ebf8b4b2a23f (diff) | |
download | bcm5719-llvm-5870373d19547b3e05bc1ec1df3b534d999e1d82.tar.gz bcm5719-llvm-5870373d19547b3e05bc1ec1df3b534d999e1d82.zip |
Improve diagnostic when failing to synthesize implicit member due to dllexport (PR22591)
This is only a problem in C++03 mode targeting MS ABI (MinGW doesn't
export inline methods, and C++11 marks these methods implicitly
deleted).
Since targeting the MS ABI in pre-C++11 mode is a rare configuration,
this will probably not get fixed, but we can at least have a better
error message.
llvm-svn: 230115
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 33f8c91691f..4d2e87798fb 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -4821,7 +4821,13 @@ static void checkDLLAttribute(Sema &S, CXXRecordDecl *Class) { // defaulted methods, and the copy and move assignment operators. The // latter are exported even if they are trivial, because the address of // an operator can be taken and should compare equal accross libraries. + DiagnosticErrorTrap Trap(S.Diags); S.MarkFunctionReferenced(Class->getLocation(), MD); + if (Trap.hasErrorOccurred()) { + S.Diag(ClassAttr->getLocation(), diag::note_due_to_dllexported_class) + << Class->getName() << !S.getLangOpts().CPlusPlus11; + break; + } // There is no later point when we will see the definition of this // function, so pass it to the consumer now. |