diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2013-09-06 21:09:09 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2013-09-06 21:09:09 +0000 |
| commit | e934af8e5876ed1fac4015f720c05538d93ab1f7 (patch) | |
| tree | fcc8fbfb65fd482fb46cea7d359d3d191fe38c33 /clang/lib/Sema/SemaDecl.cpp | |
| parent | deeafd8a5888ba113f4b5ee2e9b45a5315383013 (diff) | |
| download | bcm5719-llvm-e934af8e5876ed1fac4015f720c05538d93ab1f7.tar.gz bcm5719-llvm-e934af8e5876ed1fac4015f720c05538d93ab1f7.zip | |
Preserve exception specs in function decl merging.
Exception specs are not part of the canonical type, but we shouldn't
drop them just because we merged a noreturn attribute.
Fixes PR17110.
llvm-svn: 190206
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 68df00dec44..34f7c46b675 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2382,9 +2382,11 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD, Scope *S, } if (RequiresAdjustment) { - NewType = Context.adjustFunctionType(NewType, NewTypeInfo); - New->setType(QualType(NewType, 0)); + const FunctionType *AdjustedType = New->getType()->getAs<FunctionType>(); + AdjustedType = Context.adjustFunctionType(AdjustedType, NewTypeInfo); + New->setType(QualType(AdjustedType, 0)); NewQType = Context.getCanonicalType(New->getType()); + NewType = cast<FunctionType>(NewQType); } // If this redeclaration makes the function inline, we may need to add it to |

