diff options
author | Nico Weber <nicolasweber@gmx.de> | 2014-12-30 02:06:40 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2014-12-30 02:06:40 +0000 |
commit | 8d26b72aca165c3d9d97fce44973953600d196e5 (patch) | |
tree | 883a1f70a08189de70fc255c6bdeb8c97df2d417 /clang/lib/Sema/SemaTemplateVariadic.cpp | |
parent | 81aef1bd52b4d9cf1210077045333cc29ed29497 (diff) | |
download | bcm5719-llvm-8d26b72aca165c3d9d97fce44973953600d196e5.tar.gz bcm5719-llvm-8d26b72aca165c3d9d97fce44973953600d196e5.zip |
Don't crash on an invalid trailing return type on a function before a '...'
clang tries to produce a helpful diagnostic for the traiilng '...', but the
code that r216778 added for this doesn't expect an invalid trailing return type.
Add code to explicitly handle this.
Having explicit code for this but not for other things looks a bit strange, but
trailing return types are special in that they have a separate existence bit in
addition to the type (see r158348).
llvm-svn: 224974
Diffstat (limited to 'clang/lib/Sema/SemaTemplateVariadic.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateVariadic.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaTemplateVariadic.cpp b/clang/lib/Sema/SemaTemplateVariadic.cpp index f5883e429db..e4fab71d995 100644 --- a/clang/lib/Sema/SemaTemplateVariadic.cpp +++ b/clang/lib/Sema/SemaTemplateVariadic.cpp @@ -782,11 +782,11 @@ bool Sema::containsUnexpandedParameterPacks(Declarator &D) { Chunk.Fun.NoexceptExpr->containsUnexpandedParameterPack()) return true; - if (Chunk.Fun.hasTrailingReturnType() && - Chunk.Fun.getTrailingReturnType() - .get() - ->containsUnexpandedParameterPack()) - return true; + if (Chunk.Fun.hasTrailingReturnType()) { + QualType T = Chunk.Fun.getTrailingReturnType().get(); + if (!T.isNull() && T->containsUnexpandedParameterPack()) + return true; + } break; case DeclaratorChunk::MemberPointer: |