]> granicus.if.org Git - clang/commitdiff
Add a va_list/template instantiation test suggested by Eli
authorDouglas Gregor <dgregor@apple.com>
Wed, 20 May 2009 18:50:16 +0000 (18:50 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 20 May 2009 18:50:16 +0000 (18:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72178 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaTemplate/instantiate-expr-3.cpp

index 87f303057f2cdf293b4e9d6fac4b959d9deb4f7d..ba6c50312c893fc5e08cf58f884eb9e8f4dfec40 100644 (file)
@@ -117,6 +117,20 @@ struct VaArg0 {
 
 template struct VaArg0<int>;
 
+template<typename VaList, typename ArgType>
+struct VaArg1 {
+  void f(int n, ...) {
+    VaList va;
+    __builtin_va_start(va, n); // expected-error{{incompatible}}
+    for (int i = 0; i != n; ++i)
+      (void)__builtin_va_arg(va, ArgType);
+    __builtin_va_end(va);
+  }
+};
+
+template struct VaArg1<__builtin_va_list, int>;
+template struct VaArg1<int, int>; // expected-note{{instantiation}}
+
 // ---------------------------------------------------------------------
 // Vector element expressions
 // ---------------------------------------------------------------------