diff options
author | John McCall <rjmccall@apple.com> | 2010-04-14 01:27:20 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-04-14 01:27:20 +0000 |
commit | f19de1ce44b9c7ffdeb388d6fe2fa8a1d0288f64 (patch) | |
tree | 3b5083df4ac2275780029508c66cf72106fb2a70 /lib/Sema/SemaDecl.cpp | |
parent | 74256f5ea6950c9fd34595aa124eb4740372f15c (diff) |
Mark a function declaration invalid if any of its parameter declarations
are invalid. Prevents a crash-on-invalid during template instantiation.
I... really don't understand how this wasn't already present.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101203 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index ab61487b68..a2d0e18728 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -3098,6 +3098,9 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, assert(Param->getDeclContext() != NewFD && "Was set before ?"); Param->setDeclContext(NewFD); Params.push_back(Param); + + if (Param->isInvalidDecl()) + NewFD->setInvalidDecl(); } } |