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.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index ee6238c56c..61f0ce808a 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2390,7 +2390,8 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
FunctionDecl *NewFD;
if (isFriend) {
// DC is the namespace in which the function is being declared.
- assert(DC->isFileContext() || D.getCXXScopeSpec().isSet());
+ assert((DC->isFileContext() || PrevDecl) && "previously-undeclared "
+ "friend function being created in a non-namespace context");
// C++ [class.friend]p5
// A function can be defined in a friend declaration of a