[PATCH] D56271: [SemaCXX] Fix ICE for unexpanded parameter pack
Brian Gesiak via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 6 19:30:40 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL350501: [SemaCXX] Fix ICE for unexpanded parameter pack (authored by modocache, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56271/new/
https://reviews.llvm.org/D56271
Files:
cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
cfe/trunk/test/SemaCXX/alias-template.cpp
Index: cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
+++ cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
@@ -164,7 +164,7 @@
// 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);
Index: cfe/trunk/test/SemaCXX/alias-template.cpp
===================================================================
--- cfe/trunk/test/SemaCXX/alias-template.cpp
+++ cfe/trunk/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<typename U> using T = int;
@@ -189,3 +189,7 @@
int g = sfinae_me<int>(); // expected-error{{no matching function for call to 'sfinae_me'}}
}
+
+namespace NullExceptionDecl {
+template<int... I> auto get = []() { try { } catch(...) {}; return I; }; // expected-error{{initializer contains unexpanded parameter pack 'I'}}
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56271.180431.patch
Type: text/x-patch
Size: 1280 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190107/a7c72de4/attachment.bin>
More information about the cfe-commits
mailing list