aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index cc57bdd5f8..7d2d866828 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3269,6 +3269,12 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
NewFD->setAccess(Access);
}
+ if (NewFD->isOverloadedOperator() && !DC->isRecord() &&
+ NewFD->isInIdentifierNamespace(Decl::IDNS_Ordinary)) {
+ NewFD->setNonMemberOperator();
+ if (FunctionTemplate) FunctionTemplate->setNonMemberOperator();
+ }
+
// If we have a function template, check the template parameter
// list. This will check and merge default template arguments.
if (FunctionTemplate) {