[cfe-commits] r72144 - in /cfe/trunk: lib/Sema/SemaExpr.cpp lib/Sema/SemaTemplateInstantiateExpr.cpp test/SemaTemplate/instantiate-expr-3.cpp

Eli Friedman eli.friedman at gmail.com
Tue May 19 16:40:51 PDT 2009


On Tue, May 19, 2009 at 4:10 PM, Douglas Gregor <dgregor at apple.com> wrote:
> --- cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp (original)
> +++ cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp Tue May 19 18:10:31 2009
> @@ -100,3 +100,19 @@
>  template struct Choose0<true, int, float, int&>;
>  template struct Choose0<false, int, float, float&>;
>  template struct Choose0<true, int, float, float&>; // expected-note{{instantiation}}
> +
> +// ---------------------------------------------------------------------
> +// va_arg
> +// ---------------------------------------------------------------------
> +template<typename ArgType>
> +struct VaArg0 {
> +  void f(int n, ...) {
> +    __builtin_va_list va;
> +    __builtin_va_start(va, n);
> +    for (int i = 0; i != n; ++i)
> +      (void)__builtin_va_arg(va, ArgType);
> +    __builtin_va_end(va);
> +  }
> +};
> +
> +template struct VaArg0<int>;

it'd be nice to have a testcase where va_list is a template parameter.

-Eli




More information about the cfe-commits mailing list