diff --git a/clang/lib/Sema/SemaTemplateVariadic.cpp b/clang/lib/Sema/SemaTemplateVariadic.cpp index 3338cec5eb15..0e7fc20d2487 100644 --- a/clang/lib/Sema/SemaTemplateVariadic.cpp +++ b/clang/lib/Sema/SemaTemplateVariadic.cpp @@ -164,7 +164,7 @@ namespace { // A function parameter pack is a pack expansion, so cannot contain // an unexpanded parameter pack. Likewise for a template parameter // pack that contains any references to other packs. - if (D->isParameterPack()) + if (D && D->isParameterPack()) return true; return inherited::TraverseDecl(D); diff --git a/clang/test/SemaCXX/alias-template.cpp b/clang/test/SemaCXX/alias-template.cpp index f2ba04df78ae..0a92b9dd9639 100644 --- a/clang/test/SemaCXX/alias-template.cpp +++ b/clang/test/SemaCXX/alias-template.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -verify -std=c++11 %s +// RUN: %clang_cc1 -verify -std=c++14 -fcxx-exceptions %s namespace RedeclAliasTypedef { template using T = int; @@ -189,3 +189,7 @@ int sfinae_me() { return 0; } // expected-note{{candidate template ignored: subs int g = sfinae_me(); // expected-error{{no matching function for call to 'sfinae_me'}} } + +namespace NullExceptionDecl { +template auto get = []() { try { } catch(...) {}; return I; }; // expected-error{{initializer contains unexpanded parameter pack 'I'}} +}