[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / PCH / late-parsed-instantiations.cpp
blob7a787810a87f904d7700780b3b006882bb65929c
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
4 // RUN: %clang_cc1 -fdelayed-template-parsing -std=c++14 -emit-pch -fpch-instantiate-templates %s -o %t.pch -verify
5 // RUN: %clang_cc1 -fdelayed-template-parsing -std=c++14 -include-pch %t.pch %s -verify
7 #ifndef HEADER_INCLUDED
9 #define HEADER_INCLUDED
11 // pr33561
12 class ArrayBuffer;
13 template <typename T> class Trans_NS_WTF_RefPtr {
14 public:
15 ArrayBuffer *operator->() { return nullptr; }
17 Trans_NS_WTF_RefPtr<ArrayBuffer> get();
18 template <typename _Visitor>
19 constexpr void visit(_Visitor __visitor) {
20 __visitor(get()); // expected-note {{in instantiation}}
22 class ArrayBuffer {
23 char data() {
24 visit([](auto buffer) -> char { // expected-note {{in instantiation}}
25 buffer->data();
26 }); // expected-warning {{non-void lambda does not return a value}}
27 } // expected-warning {{non-void function does not return a value}}
30 #else
32 // expected-no-diagnostics
34 #endif