diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-03-24 19:12:22 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-03-24 19:12:22 +0000 |
commit | 6642bb3337457b3c692b1aca56d3c8ee0c46c7a4 (patch) | |
tree | cfc0658a7ac768760b6f42bfc99901463f3d9943 /clang/lib/Sema/SemaLookup.cpp | |
parent | 3db3f6d83a908c219c803b88c8deb9ecbe4b8d3f (diff) | |
download | bcm5719-llvm-6642bb3337457b3c692b1aca56d3c8ee0c46c7a4.tar.gz bcm5719-llvm-6642bb3337457b3c692b1aca56d3c8ee0c46c7a4.zip |
Change ADL to produce lookup results in a deterministic order. This fixes some
rare issues with nondeterministic diagnostic order, and some very common issues
with nondeterministic module builds.
llvm-svn: 264323
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index 00379336251..08133d68899 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -2446,7 +2446,7 @@ addAssociatedClassesAndNamespaces(AssociatedLookup &Result, // FIXME: That's not correct, we may have added this class only because it // was the enclosing class of another class, and in that case we won't have // added its base classes yet. - if (!Result.Classes.insert(Class).second) + if (!Result.Classes.insert(Class)) return; // -- If T is a template-id, its associated namespaces and classes are @@ -2496,7 +2496,7 @@ addAssociatedClassesAndNamespaces(AssociatedLookup &Result, if (!BaseType) continue; CXXRecordDecl *BaseDecl = cast<CXXRecordDecl>(BaseType->getDecl()); - if (Result.Classes.insert(BaseDecl).second) { + if (Result.Classes.insert(BaseDecl)) { // Find the associated namespace for this base class. DeclContext *BaseCtx = BaseDecl->getDeclContext(); CollectEnclosingNamespace(Result.Namespaces, BaseCtx); |