1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // UNSUPPORTED: c++98, c++03
11 
12 // See GCC PR63723.
13 // UNSUPPORTED: gcc-4.9
14 
15 // <experimental/simd>
16 //
17 // [simd.class]
18 // template <class G> explicit simd(G&& gen);
19 
20 #include <cstdint>
21 #include <experimental/simd>
22 
23 using namespace std::experimental::parallelism_v2;
24 
25 template <class T, class... Args>
26 auto not_supported_native_simd_ctor(Args&&... args)
27     -> decltype(native_simd<T>(std::forward<Args>(args)...), void()) = delete;
28 
29 template <class T>
30 void not_supported_native_simd_ctor(...) {}
31 
32 template <class T, class... Args>
33 auto supported_native_simd_ctor(Args&&... args)
34     -> decltype(native_simd<T>(std::forward<Args>(args)...), void()) {}
35 
36 template <class T>
37 void supported_native_simd_ctor(...) = delete;
38 
39 void compile_generator() {
40   supported_native_simd_ctor<int>([](int i) { return i; });
41   not_supported_native_simd_ctor<int>([](int i) { return float(i); });
42   not_supported_native_simd_ctor<int>([](intptr_t i) { return (int*)(i); });
43   not_supported_native_simd_ctor<int>([](int* i) { return i; });
44 }
45 
46 int main() {}
47