aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-09-05 17:52:12 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-09-05 17:52:12 +0000
commit37c765a5ccf69fb9a467c8499675ae568811afe3 (patch)
tree3e4d14bc1ff560fdf23cc5edc0630fc715cca30e /lib/Sema/SemaDecl.cpp
parente885dd6a135a335422f33e5f1aa64b8d62c84255 (diff)
c error recovery. treat an invalid redeclaration
of a c-function for what it is. Otherwise, this func is treated as an overloadable c-function resulting in a crash much later. // rdar://11743706 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 2582e13248..6fff4b15a4 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -5565,6 +5565,9 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous,
isExplicitSpecialization));
}
+ // Make graceful recovery from an invalid redeclaration.
+ else if (!Previous.empty())
+ D.setRedeclaration(true);
assert((NewFD->isInvalidDecl() || !D.isRedeclaration() ||
Previous.getResultKind() != LookupResult::FoundOverloaded) &&
"previous declaration set still overloaded");