1 // RUN: %clang_cc1 -fsyntax-only %s -std=c++1z -verify
4 template<a
> // expected-error +{{}}
7 template<a
> // expected-error +{{}}
8 template<int,typename T1
,typename
>
14 template<class>struct aaa
16 typedef ac
<1,int,int>::ae ae
// expected-error +{{}}
22 typedef aaa
<int>::ae aaa
;
29 struct region_processing_helper
35 struct In
<a::int_
<aaa::a
>,my
>; // expected-error +{{}}
40 In
<a::int_
<0> > a
; // expected-error +{{}}
42 } // expected-error +{{}}
46 region_processing_helper
<int>* helper
;
47 helper
->process(0) // expected-error +{{}}
58 template <int> struct enable_if
;
59 template <class > struct remove_reference
;
60 template <class _Tp
> struct remove_reference
<_Tp
&> ;
62 template <class > struct __tuple_like
;
64 template <class _Tp
, class _Up
, int = __tuple_like
<typename remove_reference
<_Tp
>::type
>::value
>
65 struct __tuple_convertible
;
69 template<class _Tuple
, int = enable_if
<__tuple_convertible
<_Tuple
, pair
>::value
>::type
>
73 template <class> struct basic_ostream
;
78 extern basic_ostream
<char> cout
;
80 int operator<<( basic_ostream
<char> , pair
) ; // expected-note +{{}}
82 void register_object_imp ( )
84 cout
<< endl
<1>; // expected-error +{{}}
89 template<typename S
> // expected-error +{{}}
91 void function(S a
, T b
) {}
94 function(0, 1); // expected-error +{{}}
99 // A buildbot failure from libcxx
100 namespace libcxx_test
{
101 template <class _Ptr
, bool> struct __pointer_traits_element_type
;
102 template <class _Ptr
> struct __pointer_traits_element_type
<_Ptr
, true>;
103 template <template <class, class...> class _Sp
, class _Tp
, class ..._Args
> struct __pointer_traits_element_type
<_Sp
<_Tp
, _Args
...>, true> {
106 template <class T
> struct B
{};
107 __pointer_traits_element_type
<B
<int>, true>::type x
;
110 namespace PR14281_part1
{
111 template <class P
, int> struct A
;
112 template <class P
> struct A
<P
, 1>;
113 template <template <class, int> class S
, class T
> struct A
<S
<T
, 1>, 1> {
116 template <class T
, int i
> struct B
{};
117 A
<B
<int, 1>, 1>::type x
;
120 namespace PR14281_part2
{
121 typedef decltype(nullptr) nullptr_t
;
122 template <class P
, nullptr_t
> struct A
;
123 template <class P
> struct A
<P
, nullptr>;
124 template <template <class, nullptr_t
> class S
, class T
> struct A
<S
<T
, nullptr>, nullptr> {
127 template <class T
, nullptr_t i
> struct B
{};
128 A
<B
<int, nullptr>, nullptr>::type x
;
131 namespace PR14281_part3
{
132 extern int some_decl
;
133 template <class P
, int*> struct A
;
134 template <class P
> struct A
<P
, &some_decl
>;
135 template <template <class, int*> class S
, class T
> struct A
<S
<T
, &some_decl
>, &some_decl
> {
138 template <class T
, int* i
> struct B
{};
139 A
<B
<int, &some_decl
>, &some_decl
>::type x
;
142 namespace var_template_partial_spec_incomplete
{
143 template<typename T
> int n
;
144 template<typename T
, typename U
= void> int n
<T
*>; // expected-error +{{}} expected-note {{}}
148 namespace deduceFunctionSpecializationForInvalidOutOfLineFunction
{
150 template <typename InputT
, typename OutputT
>
151 struct SourceSelectionRequirement
{
153 OutputT
evaluateSelectionRequirement(InputT
&&Value
) {
157 template <typename InputT
, typename OutputT
>
158 OutputT SourceSelectionRequirement
<InputT
, OutputT
>::
159 evaluateSelectionRequirement
<void>(InputT
&&Value
) { // expected-error {{cannot specialize a member of an unspecialized template}}
165 namespace PR51872_part1
{
166 template<int> class T1
{ template <struct U1
> T1(); };
167 // expected-error@-1 {{non-type template parameter has incomplete type 'struct U1'}}
168 // expected-note@-2 {{forward declaration of 'PR51872_part1::U1'}}
171 // expected-error@-1 {{no viable constructor or deduction guide for deduction of template arguments of 'T1'}}
172 // expected-note@-6 {{candidate template ignored: could not match 'T1<>' against 'int'}}