diff options
author | Sean Hunt <scshunt@csclub.uwaterloo.ca> | 2011-05-04 01:19:04 +0000 |
---|---|---|
committer | Sean Hunt <scshunt@csclub.uwaterloo.ca> | 2011-05-04 01:19:04 +0000 |
commit | fa74c2344addf92826c938758fb4dc612a004eb9 (patch) | |
tree | 8acbaf0a2a9f3b5b20b8fce80e3c33260cb706dc /lib/Sema/SemaDeclCXX.cpp | |
parent | 3afa9753fa1243bb652bc5387ecf71044c24fd90 (diff) |
Ensure that delegating constructor loop detection uses canonical
declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130821 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 6cd5e43241..641bcd831b 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -2072,10 +2072,10 @@ static bool CollectFieldInitializer(BaseAndFieldInfo &Info, bool Sema::SetDelegatingInitializer(CXXConstructorDecl *Constructor, CXXCtorInitializer *Initializer) { - // FIXME: This doesn't catch indirect loops yet CXXConstructorDecl *Target = Initializer->getTargetConstructor(); + CXXConstructorDecl *Canonical = Constructor->getCanonicalDecl(); while (Target) { - if (Target == Constructor) { + if (Target->getCanonicalDecl() == Canonical) { Diag(Initializer->getSourceLocation(), diag::err_delegating_ctor_loop) << Constructor; return true; |