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 // 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 6 7 #ifndef HEADER_INCLUDED 8 9 #define HEADER_INCLUDED 10 11 // pr33561 12 class ArrayBuffer; 13 template <typename T> class Trans_NS_WTF_RefPtr { 14 public: operator ->()15 ArrayBuffer *operator->() { return nullptr; } 16 }; 17 Trans_NS_WTF_RefPtr<ArrayBuffer> get(); 18 template <typename _Visitor> visit(_Visitor __visitor)19constexpr void visit(_Visitor __visitor) { 20 __visitor(get()); // expected-note {{in instantiation}} 21 } 22 class ArrayBuffer { data()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}} 28 }; 29 30 #else 31 32 // expected-no-diagnostics 33 34 #endif 35