summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-11-22 22:55:12 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-11-22 22:55:12 +0000
commit8dbc6b26171167b8ddf66a5f4b6d6fb9baf28336 (patch)
treeeef30092e1f6e8dc67f6156abf2bdd59e5afd565 /clang/lib/Sema
parent1e6ca44a8e6a8e9d562a7788b64cc6689652ee2c (diff)
downloadbcm5719-llvm-8dbc6b26171167b8ddf66a5f4b6d6fb9baf28336.tar.gz
bcm5719-llvm-8dbc6b26171167b8ddf66a5f4b6d6fb9baf28336.zip
Make diagnostic for use of default member initializer before enclosing class is
complete a little more general; it is produced in other cases than the one that it previously talked about. llvm-svn: 287713
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp11
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp12
2 files changed, 7 insertions, 16 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 7d208a43ada..b036e0c0dc2 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -12378,14 +12378,9 @@ ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) {
// constructor before the initializer is lexically complete will ultimately
// come here at which point we can diagnose it.
RecordDecl *OutermostClass = ParentRD->getOuterLexicalRecordContext();
- if (OutermostClass == ParentRD) {
- Diag(Field->getLocEnd(), diag::err_in_class_initializer_not_yet_parsed)
- << ParentRD << Field;
- } else {
- Diag(Field->getLocEnd(),
- diag::err_in_class_initializer_not_yet_parsed_outer_class)
- << ParentRD << OutermostClass << Field;
- }
+ Diag(Loc, diag::err_in_class_initializer_not_yet_parsed)
+ << OutermostClass << Field;
+ Diag(Field->getLocEnd(), diag::note_in_class_initializer_not_yet_parsed);
return ExprError();
}
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index 96b45d17d1c..321fd6995be 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -2198,14 +2198,10 @@ bool Sema::InstantiateInClassInitializer(
if (!OldInit) {
RecordDecl *PatternRD = Pattern->getParent();
RecordDecl *OutermostClass = PatternRD->getOuterLexicalRecordContext();
- if (OutermostClass == PatternRD) {
- Diag(Pattern->getLocEnd(), diag::err_in_class_initializer_not_yet_parsed)
- << PatternRD << Pattern;
- } else {
- Diag(Pattern->getLocEnd(),
- diag::err_in_class_initializer_not_yet_parsed_outer_class)
- << PatternRD << OutermostClass << Pattern;
- }
+ Diag(PointOfInstantiation,
+ diag::err_in_class_initializer_not_yet_parsed)
+ << OutermostClass << Pattern;
+ Diag(Pattern->getLocEnd(), diag::note_in_class_initializer_not_yet_parsed);
Instantiation->setInvalidDecl();
return true;
}
OpenPOWER on IntegriCloud