1 // RUN: %clang_cc1 -fsyntax-only -verify %s
8 // expected-note@-1 {{member found by ambiguous name lookup}}
13 // expected-note@-1 {{member found by ambiguous name lookup}}
21 struct E
; // expected-note {{forward declaration of 'E'}}
23 void f(C
&c
, D
& d
, E
& e
) {
25 // expected-error@-1 {{member 'operator->' found in multiple base classes of different types}}
27 e
->f(); // expected-error{{incomplete definition of type}}
30 namespace rdar8875304
{
32 class Line_Segment
{ public: Line_Segment(const Point
&){} };
33 class Node
{ public: Point
Location(){ Point p
; return p
; } };
38 Line_Segment(node1
->Location()); // expected-error {{not a structure or union}}
43 namespace arrow_suggest
{
48 wrapped_ptr(T
* ptr
) : ptr_(ptr
) {}
49 T
* operator->() { return ptr_
; }
50 void Check(); // expected-note {{'Check' declared here}}
57 void DoSomething(); // expected-note {{'DoSomething' declared here}}
62 wrapped_ptr
<Worker
> worker(new Worker
);
63 worker
.DoSomething(); // expected-error {{no member named 'DoSomething' in 'arrow_suggest::wrapped_ptr<arrow_suggest::Worker>'; did you mean to use '->' instead of '.'?}}
64 worker
.DoSamething(); // expected-error {{no member named 'DoSamething' in 'arrow_suggest::wrapped_ptr<arrow_suggest::Worker>'; did you mean to use '->' instead of '.'?}} \
65 // expected-error {{no member named 'DoSamething' in 'arrow_suggest::Worker'; did you mean 'DoSomething'?}}
66 worker
.Chuck(); // expected-error {{no member named 'Chuck' in 'arrow_suggest::wrapped_ptr<arrow_suggest::Worker>'; did you mean 'Check'?}}
69 } // namespace arrow_suggest
71 namespace no_crash_dependent_type
{
81 // The "requires an initializer" error seems unnecessary.
82 A
<int> &x
= blah
[7]; // expected-error {{use of undeclared identifier 'blah'}} \
83 // expected-error {{requires an initializer}}
89 foo
<int>(); // expected-note {{requested here}}
92 } // namespace no_crash_dependent_type
94 namespace clangd_issue_1073_no_crash_dependent_type
{
96 template <typename T
> struct Ptr
{
105 struct TemplateStruct
{
106 Ptr
<Struct
> val(); // expected-note {{declared here}}
110 void templateFunc(const TemplateStruct
<I
> &ts
) {
111 Ptr
<Struct
> ptr
= ts
.val(); // expected-error {{function is not marked const}}
115 template void templateFunc
<0>(const TemplateStruct
<0> &); // expected-note {{requested here}}
117 } // namespace clangd_issue_1073_no_crash_dependent_type