Clang Project

clang_source_code/test/PCH/cxx-variadic-templates-with-default-params.cpp
1// Test this without pch.
2// RUN: %clang_cc1 -std=c++11 -include %s -fsyntax-only -verify %s
3
4// Test with pch.
5// RUN: %clang_cc1 -std=c++11 -x c++-header -emit-pch -o %t %s
6// RUN: %clang_cc1 -std=c++11 -include-pch %t -fsyntax-only -verify %s
7
8// expected-no-diagnostics
9
10// PR25271: Ensure that default template arguments prior to a parameter pack
11// successfully round-trip.
12#ifndef HEADER
13#define HEADER
14template<unsigned T=123, unsigned... U>
15class dummy;
16
17template<unsigned T, unsigned... U>
18class dummy {
19    int field[T];
20};
21#else
22void f() {
23    dummy<> x;
24    (void)x;
25}
26#endif
27