diff options
author | John McCall <rjmccall@apple.com> | 2011-07-06 07:30:07 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-07-06 07:30:07 +0000 |
commit | c8fc90a854b4ccba21c85884676a80334159dd94 (patch) | |
tree | ef5ec11fad205975fcf3edf0143f07585e6e594b /test/CodeGenCXX/variadic-templates.cpp | |
parent | 9dc71d2fddcd283e07d45f3894c8559e2f7dd9a7 (diff) |
When tree-transforming an expression sequence, always flag expanded
variadic argument pack expansions as having changed, rather than doing
it for each changed expansion, which leaves out zero-argument packs
with catastrophic consequences.
Fixes PR10260.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134483 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/variadic-templates.cpp')
-rw-r--r-- | test/CodeGenCXX/variadic-templates.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/variadic-templates.cpp b/test/CodeGenCXX/variadic-templates.cpp index 4f3cf1fe9d..90c8370675 100644 --- a/test/CodeGenCXX/variadic-templates.cpp +++ b/test/CodeGenCXX/variadic-templates.cpp @@ -9,4 +9,15 @@ int get_num_types(Types...) { // CHECK: ret i32 3 template int get_num_types(int, float, double); +// PR10260 - argument packs that expand to nothing +namespace test1 { + template <class... T> void foo() { + int values[sizeof...(T)+1] = { T::value... }; + // CHECK: define linkonce_odr void @_ZN5test13fooIJEEEvv() + // CHECK: alloca [1 x i32], align 4 + } + void test() { + foo<>(); + } +} |