blob: c56bec33a0f869155119a971ec789030a42c26a8 [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
Douglas Gregor9370c8f2011-01-12 22:11:34 +00002
3template<typename ...Types>
4int get_num_types(Types...) {
5 return sizeof...(Types);
6}
7
Douglas Gregordce73972011-01-13 18:03:24 +00008// CHECK: define weak_odr i32 @_Z13get_num_typesIJifdEEiDpT_
Douglas Gregor9370c8f2011-01-12 22:11:34 +00009// CHECK: ret i32 3
10template int get_num_types(int, float, double);
11
John McCallc8fc90a2011-07-06 07:30:07 +000012// PR10260 - argument packs that expand to nothing
13namespace test1 {
14 template <class... T> void foo() {
15 int values[sizeof...(T)+1] = { T::value... };
16 // CHECK: define linkonce_odr void @_ZN5test13fooIJEEEvv()
17 // CHECK: alloca [1 x i32], align 4
18 }
Douglas Gregor9370c8f2011-01-12 22:11:34 +000019
John McCallc8fc90a2011-07-06 07:30:07 +000020 void test() {
21 foo<>();
22 }
23}