aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2010-07-16 04:32:28 +0000
committerChandler Carruth <chandlerc@gmail.com>2010-07-16 04:32:28 +0000
commitb21fc4a4c17fdf7d3de4fd3cd36a1ad4d8af6f55 (patch)
tree7f4fad6844888b2066ffc8756cdbdc8c524f94b8 /lib/Sema/SemaDecl.cpp
parent1e4c33a677ba085bbbbfff211719ae4bb571c5b1 (diff)
Butcher a perfectly reasonable diagnostic to pacify old versions of SWIG.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108505 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 76cb90565b..538d56470f 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3479,14 +3479,14 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
// definition (C++ [dcl.meaning]p1).
// Note that this is not the case for explicit specializations of
// function templates or member functions of class templates, per
- // C++ [temp.expl.spec]p2.
+ // C++ [temp.expl.spec]p2. We also allow these declarations as an extension
+ // for compatibility with old SWIG code which likes to generate them.
if (!IsFunctionDefinition && !isFriend &&
!isFunctionTemplateSpecialization && !isExplicitSpecialization) {
- Diag(NewFD->getLocation(), diag::err_out_of_line_declaration)
+ Diag(NewFD->getLocation(), diag::ext_out_of_line_declaration)
<< D.getCXXScopeSpec().getRange();
- NewFD->setInvalidDecl();
- } else if (!Redeclaration &&
- !(isFriend && CurContext->isDependentContext())) {
+ }
+ if (!Redeclaration && !(isFriend && CurContext->isDependentContext())) {
// The user tried to provide an out-of-line definition for a
// function that is a member of a class or namespace, but there
// was no such member function declared (C++ [class.mfct]p2,