1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
5 // We have to avoid ADL for this test.
7 template <unsigned N
> class test
{};
9 class foo
{}; // expected-note {{candidate constructor (the implicit copy constructor) not viable}}
10 #if __cplusplus >= 201103L // C++11 or later
11 // expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
13 test
<0> foo(foo
); // expected-note {{candidate}}
17 test
<1> foo(class foo
);
20 test
<2> foo(class ::foo
); // expected-note {{candidate}} \
21 // expected-note{{passing argument to parameter here}}
40 // Argument-dependent lookup is ambiguous between B:: and ::.
41 test
<0> _0
= foo(a
); // expected-error {{call to 'foo' is ambiguous}}
43 // But basic unqualified lookup is not.
44 test
<2> _1
= (foo
)(a
);
47 test
<2> _2
= (foo
)(b
); // expected-error {{no viable conversion from 'class Test0::foo' to 'class ::foo'}}
62 int c(); // expected-note {{target of using declaration}}
68 using typename
C::c
; // expected-error {{'typename' keyword used on a non-type}}
84 using A::operator int; // expected-note {{declared protected here}}
86 using A::operator bool;
91 return B(); // expected-error {{'operator int' is a protected member of 'test2::B'}}
109 using B::operator A
*;