forked from OSchip/llvm-project
Check for an invalid field earlier in a constructor's initialization
of that field. Otherwise, we can end up building and later trying to instantiate a dependent member initializer that will fail at instantiation time. Unfortunately, I've only managed to trigger this bug with very large sources, so there's no test case :( llvm-svn: 118306
This commit is contained in:
parent
b0ca9eb294
commit
266bb5fd5b
|
@ -1252,6 +1252,9 @@ Sema::BuildMemberInitializer(FieldDecl *Member, Expr **Args,
|
|||
unsigned NumArgs, SourceLocation IdLoc,
|
||||
SourceLocation LParenLoc,
|
||||
SourceLocation RParenLoc) {
|
||||
if (Member->isInvalidDecl())
|
||||
return true;
|
||||
|
||||
// Diagnose value-uses of fields to initialize themselves, e.g.
|
||||
// foo(foo)
|
||||
// where foo is not also a parameter to the constructor.
|
||||
|
@ -1294,9 +1297,6 @@ Sema::BuildMemberInitializer(FieldDecl *Member, Expr **Args,
|
|||
|
||||
}
|
||||
|
||||
if (Member->isInvalidDecl())
|
||||
return true;
|
||||
|
||||
// Initialize the member.
|
||||
InitializedEntity MemberEntity =
|
||||
InitializedEntity::InitializeMember(Member, 0);
|
||||
|
|
Loading…
Reference in New Issue