brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 080be09 Raw
39 lines · cpp
1// RUN: %clang_cc1 -Wno-error=return-type -fdelayed-template-parsing -std=c++14 -emit-pch %s -o %t.pch -verify2// RUN: %clang_cc1 -Wno-error=return-type -fdelayed-template-parsing -std=c++14 -include-pch %t.pch %s -verify3 4// RUN: %clang_cc1 -Wno-error=return-type -fdelayed-template-parsing -std=c++14 -emit-pch -fpch-instantiate-templates %s -o %t.pch -verify5// RUN: %clang_cc1 -Wno-error=return-type -fdelayed-template-parsing -std=c++14 -include-pch %t.pch %s -verify6 7// Run this test for i686 as this is the target that modifies default FP options.8// RUN: %clang_cc1 -Wno-error=return-type -triple i686-pc-linux-gnu -fdelayed-template-parsing -std=c++14 -emit-pch -fpch-instantiate-templates %s -o %t.pch -verify9// RUN: %clang_cc1 -Wno-error=return-type -triple i686-pc-linux-gnu -fdelayed-template-parsing -std=c++14 -include-pch %t.pch %s -verify10 11#ifndef HEADER_INCLUDED12 13#define HEADER_INCLUDED14 15// pr3356116class ArrayBuffer;17template <typename T> class Trans_NS_WTF_RefPtr {18public:19  ArrayBuffer *operator->() { return nullptr; }20};21Trans_NS_WTF_RefPtr<ArrayBuffer> get();22template <typename _Visitor>23constexpr void visit(_Visitor __visitor) {24  __visitor(get()); // expected-note {{in instantiation}}25}26class ArrayBuffer {27  char data() {28    visit([](auto buffer) -> char { // expected-note {{in instantiation}}29      buffer->data();30    }); // expected-warning {{non-void lambda does not return a value}}31  } // expected-warning {{non-void function does not return a value}}32};33 34#else35 36// expected-no-diagnostics37 38#endif39