[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / cxx1z-class-deduction.cpp
blobbf436e7ec98023205b583716d355f82d0b3d2eb6
1 // RUN: %clang_cc1 -std=c++1z %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
3 template<typename T> struct A {
4 A(T = 0);
5 A(void*);
6 };
8 template<typename T> A(T*) -> A<long>;
9 A() -> A<int>;
11 // CHECK-LABEL: @_Z1fPi(
12 void f(int *p) {
13 // CHECK: @_ZN1AIiEC
14 A a{};
16 // CHECK: @_ZN1AIlEC
17 A b = p;
19 // CHECK: @_ZN1AIxEC
20 A c = 123LL;
23 namespace N {
24 template<typename T> struct B { B(T); };
26 using N::B;
28 struct X {
29 template<typename T> struct C { C(T); };
32 // CHECK: @_Z1gIiEDaT_DTcv1AfL0p_ES1_IS0_E
33 template<typename T> auto g(T x, decltype(A(x)), A<T>) {}
34 // CHECK: @_Z1hIiEDaT_DTcvN1N1BEfL0p_ENS2_IS0_EE
35 template<typename T> auto h(T x, decltype(B(x)), B<T>) {}
36 // CHECK: @_Z1iI1XiEDaT0_DTcvNT_1CEfL0p_ENS2_1CIS1_EE(
37 template<typename U, typename T> auto i(T x, decltype(typename U::C(x)), typename U::template C<T>) {}
38 void test() {
39 g(1, 2, A(3));
40 h(1, 2, B(3));
41 i<X>(1, 2, X::C(3));