blob: f1fe8bb06a516103dc0e005c9f947c4bb4127917 [file] [log] [blame]
Reid Kleckner24bd88c2018-03-26 18:22:47 +00001// 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
9class ArrayBuffer;
10template <typename T> class Trans_NS_WTF_RefPtr {
11public:
12 ArrayBuffer *operator->() { return nullptr; }
13};
14Trans_NS_WTF_RefPtr<ArrayBuffer> get();
15template <typename _Visitor>
16constexpr void visit(_Visitor __visitor) {
17 __visitor(get()); // expected-note {{in instantiation}}
18}
19class 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