1 | // RUN: %clang_cc1 -fdelayed-template-parsing -std=c++14 -emit-pch %s -o %t.pch -verify |
2 | // RUN: %clang_cc1 -fdelayed-template-parsing -std=c++14 -include-pch %t.pch %s -verify |
3 | |
4 | #ifndef HEADER_INCLUDED |
5 | |
6 | #define HEADER_INCLUDED |
7 | |
8 | // pr33561 |
9 | class ArrayBuffer; |
10 | template <typename T> class Trans_NS_WTF_RefPtr { |
11 | public: |
12 | ArrayBuffer *operator->() { return nullptr; } |
13 | }; |
14 | Trans_NS_WTF_RefPtr<ArrayBuffer> get(); |
15 | template <typename _Visitor> |
16 | constexpr void visit(_Visitor __visitor) { |
17 | __visitor(get()); // expected-note {{in instantiation}} |
18 | } |
19 | class ArrayBuffer { |
20 | char data() { |
21 | visit([](auto buffer) -> char { // expected-note {{in instantiation}} |
22 | buffer->data(); |
23 | }); // expected-warning {{control reaches end of non-void lambda}} |
24 | } // expected-warning {{control reaches end of non-void function}} |
25 | }; |
26 | |
27 | #else |
28 | |
29 | // expected-no-diagnostics |
30 | |
31 | #endif |
32 | |