diff options
author | Faisal Vali <faisalv@yahoo.com> | 2016-05-19 02:28:21 +0000 |
---|---|---|
committer | Faisal Vali <faisalv@yahoo.com> | 2016-05-19 02:28:21 +0000 |
commit | 683b0742099ce1eb34fb3031f4cd5282262cadbe (patch) | |
tree | 6b3d3fdda0b8bf0f787a7c7209552afd2b8c9202 /clang/lib/AST/CXXInheritance.cpp | |
parent | 1fec404da0eadd11dcd2cff11d204722f57a9401 (diff) | |
download | llvm-683b0742099ce1eb34fb3031f4cd5282262cadbe.zip llvm-683b0742099ce1eb34fb3031f4cd5282262cadbe.tar.gz llvm-683b0742099ce1eb34fb3031f4cd5282262cadbe.tar.bz2 |
Fix PR27601 by reverting [r267453] - Refactor traversal of bases in deduction of template parameters from base
This reversal is being done with r267453's author's (i.e. Richard Smith's) permission.
This fixes https://llvm.org/bugs/show_bug.cgi?id=27601
Also, per Richard's request the examples from the bug report have been added to our test suite.
llvm-svn: 270016
Diffstat (limited to 'clang/lib/AST/CXXInheritance.cpp')
-rw-r--r-- | clang/lib/AST/CXXInheritance.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/clang/lib/AST/CXXInheritance.cpp b/clang/lib/AST/CXXInheritance.cpp index d1a2b43..6a6ca76 100644 --- a/clang/lib/AST/CXXInheritance.cpp +++ b/clang/lib/AST/CXXInheritance.cpp @@ -137,7 +137,6 @@ CXXRecordDecl::isCurrentInstantiation(const DeclContext *CurContext) const { bool CXXRecordDecl::forallBases(ForallBasesCallback BaseMatches, bool AllowShortCircuit) const { SmallVector<const CXXRecordDecl*, 8> Queue; - llvm::SmallPtrSet<const CXXRecordDecl*, 8> Enqueued; const CXXRecordDecl *Record = this; bool AllMatches = true; @@ -159,14 +158,12 @@ bool CXXRecordDecl::forallBases(ForallBasesCallback BaseMatches, AllMatches = false; continue; } - - if (Enqueued.insert(Base).second) { - Queue.push_back(Base); - if (!BaseMatches(Base)) { - if (AllowShortCircuit) return false; - AllMatches = false; - continue; - } + + Queue.push_back(Base); + if (!BaseMatches(Base)) { + if (AllowShortCircuit) return false; + AllMatches = false; + continue; } } |