1 // RUN: %clang_cc1 -fsyntax-only -verify %s -pedantic
9 void push_back(const T
&) { int a
[sizeof(T
) ? -1: -1]; } // expected-error {{array with a negative size}}
14 typedef vector
<S
<void *> >CheckersOrdered
;
15 CheckersOrdered Checkers
;
17 template <typename CHECKER
>
18 void registerCheck(CHECKER
*check
) {
19 Checkers
.push_back(S
<void *>()); // expected-note {{in instantiation of member function 'vector<S<void *>>::push_back' requested here}}
23 class RetainReleaseChecker
{ };
25 void f(ExprEngine
& Eng
) {
26 Eng
.registerCheck(new RetainReleaseChecker
); // expected-note {{in instantiation of function template specialization 'ExprEngine::registerCheck<RetainReleaseChecker>' requested here}}
31 template<typename T
> struct A
{
35 template<typename T
> struct B
: A
<float>, A
<T
> {
37 a
= 0; // should not be ambiguous
40 template struct B
<int>;
44 template<typename T
> struct B
: A
<T
> {
46 a
= 0; // expected-error {{'test1::O::a' is not a member of class 'test1::O::B<int>'}}
50 template struct O::B
<int>; // expected-note {{in instantiation}}
55 template <class T
> struct A
{
57 T::bar(); // expected-error {{type 'int' cannot}}
61 template <class T
> class B
{
63 a
.test2::template A
<T
>::foo(); // expected-note {{in instantiation}}
67 template class B
<int>;
71 template<typename T
> struct S
{
74 template<typename T
> void f() { S
<T
>::value
; } // expected-error {{invalid use of non-static data member 'value'}}
75 template void f
<int>(); // expected-note {{in instantiation of}}
77 struct List
{ List
*next
; };
78 template<typename T
, T
*(T::*p
) = &T::next
> struct A
{};
80 void operator&(struct Whatever
);
81 template<typename T
, T
*(T::*p
) = &T::next
> struct B
{};
82 B
<List
> b
; // still ok