summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-07-31 00:24:28 +0000
committerEric Fiselier <eric@efcs.ca>2017-07-31 00:24:28 +0000
commit5485cc15c37ef2b684ba442f6563ca8883d958cc (patch)
treeea9a8e8ce153b7a02f1f8c9d01e1c3e8468fa13d /clang/lib/Sema/SemaLookup.cpp
parent4dd663752dfaf2de2236d250e23d6e0a9c4c8968 (diff)
downloadbcm5719-llvm-5485cc15c37ef2b684ba442f6563ca8883d958cc.tar.gz
bcm5719-llvm-5485cc15c37ef2b684ba442f6563ca8883d958cc.zip
[Sema] Fix operator lookup to consider local extern declarations.
Summary: Previously Clang was not considering operator declarations that occur at function scope. This is incorrect according to [over.match.oper]p3 > The set of non-member candidates is the result of the unqualified lookup of operator@ in the context of the expression according to the usual rules for name lookup in unqualified function calls. This patch changes operator name lookup to consider block scope declarations. This patch fixes PR27027. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35297 llvm-svn: 309530
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 85596ed52e9..4f88edcb31f 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -1031,7 +1031,8 @@ struct FindLocalExternScope {
FindLocalExternScope(LookupResult &R)
: R(R), OldFindLocalExtern(R.getIdentifierNamespace() &
Decl::IDNS_LocalExtern) {
- R.setFindLocalExtern(R.getIdentifierNamespace() & Decl::IDNS_Ordinary);
+ R.setFindLocalExtern(R.getIdentifierNamespace() &
+ (Decl::IDNS_Ordinary | Decl::IDNS_NonMemberOperator));
}
void restore() {
R.setFindLocalExtern(OldFindLocalExtern);
OpenPOWER on IntegriCloud