[cfe-commits] r72178 - /cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp
Douglas Gregor
dgregor at apple.com
Wed May 20 11:50:17 PDT 2009
Author: dgregor
Date: Wed May 20 13:50:16 2009
New Revision: 72178
URL: http://llvm.org/viewvc/llvm-project?rev=72178&view=rev
Log:
Add a va_list/template instantiation test suggested by Eli
Modified:
cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp
Modified: cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp?rev=72178&r1=72177&r2=72178&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp Wed May 20 13:50:16 2009
@@ -117,6 +117,20 @@
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
// ---------------------------------------------------------------------
More information about the cfe-commits
mailing list