diff --git a/clang/lib/Headers/hlsl/hlsl_detail.h b/clang/lib/Headers/hlsl/hlsl_detail.h index c691d85283de4..80c4900121dfb 100644 --- a/clang/lib/Headers/hlsl/hlsl_detail.h +++ b/clang/lib/Headers/hlsl/hlsl_detail.h @@ -45,6 +45,10 @@ template struct is_arithmetic { static const bool Value = __is_arithmetic(T); }; +template +using HLSL_FIXED_VECTOR = + vector<__detail::enable_if_t<(N > 1 && N <= 4), T>, N>; + } // namespace __detail } // namespace hlsl #endif //_HLSL_HLSL_DETAILS_H_ diff --git a/clang/lib/Headers/hlsl/hlsl_intrinsic_helpers.h b/clang/lib/Headers/hlsl/hlsl_intrinsic_helpers.h index 6783e23f6346d..87b52792447f6 100644 --- a/clang/lib/Headers/hlsl/hlsl_intrinsic_helpers.h +++ b/clang/lib/Headers/hlsl/hlsl_intrinsic_helpers.h @@ -23,11 +23,7 @@ constexpr vector d3d_color_to_ubyte4_impl(vector V) { return V.zyxw * 255.001953f; } -template -constexpr enable_if_t::value || is_same::value, T> -length_impl(T X) { - return abs(X); -} +template constexpr T length_impl(T X) { return abs(X); } template constexpr enable_if_t::value || is_same::value, T> @@ -39,9 +35,7 @@ length_vec_impl(vector X) { #endif } -template -constexpr enable_if_t::value || is_same::value, T> -distance_impl(T X, T Y) { +template constexpr T distance_impl(T X, T Y) { return length_impl(X - Y); } @@ -51,9 +45,7 @@ distance_vec_impl(vector X, vector Y) { return length_vec_impl(X - Y); } -template -constexpr enable_if_t::value || is_same::value, T> -reflect_impl(T I, T N) { +template constexpr T reflect_impl(T I, T N) { return I - 2 * N * I * N; } diff --git a/clang/lib/Headers/hlsl/hlsl_intrinsics.h b/clang/lib/Headers/hlsl/hlsl_intrinsics.h index cd6d836578787..47a7066b2b3e1 100644 --- a/clang/lib/Headers/hlsl/hlsl_intrinsics.h +++ b/clang/lib/Headers/hlsl/hlsl_intrinsics.h @@ -89,23 +89,31 @@ void asuint(double4, out uint4, out uint4); /// \param X The X input value. /// \param Y The Y input value. +template _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) -const inline half distance(half X, half Y) { +const inline __detail::enable_if_t<__detail::is_arithmetic::Value && + __detail::is_same::value, + T> distance(T X, T Y) { return __detail::distance_impl(X, Y); } -const inline float distance(float X, float Y) { +template +const inline __detail::enable_if_t< + __detail::is_arithmetic::Value && __detail::is_same::value, T> +distance(T X, T Y) { return __detail::distance_impl(X, Y); } template _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) -const inline half distance(vector X, vector Y) { +const inline half distance(__detail::HLSL_FIXED_VECTOR X, + __detail::HLSL_FIXED_VECTOR Y) { return __detail::distance_vec_impl(X, Y); } template -const inline float distance(vector X, vector Y) { +const inline float distance(__detail::HLSL_FIXED_VECTOR X, + __detail::HLSL_FIXED_VECTOR Y) { return __detail::distance_vec_impl(X, Y); } @@ -119,17 +127,29 @@ const inline float distance(vector X, vector Y) { /// /// Length is based on the following formula: sqrt(x[0]^2 + x[1]^2 + ...). +template _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) -const inline half length(half X) { return __detail::length_impl(X); } -const inline float length(float X) { return __detail::length_impl(X); } +const inline __detail::enable_if_t<__detail::is_arithmetic::Value && + __detail::is_same::value, + T> length(T X) { + return __detail::length_impl(X); +} + +template +const inline __detail::enable_if_t< + __detail::is_arithmetic::Value && __detail::is_same::value, T> +length(T X) { + return __detail::length_impl(X); +} template _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) -const inline half length(vector X) { +const inline half length(__detail::HLSL_FIXED_VECTOR X) { return __detail::length_vec_impl(X); } -template const inline float length(vector X) { +template +const inline float length(__detail::HLSL_FIXED_VECTOR X) { return __detail::length_vec_impl(X); } @@ -173,23 +193,33 @@ constexpr vector D3DCOLORtoUBYTE4(vector V) { /// /// Result type and the type of all operands must be the same type. +template _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) -const inline half reflect(half I, half N) { +const inline __detail::enable_if_t<__detail::is_arithmetic::Value && + __detail::is_same::value, + T> reflect(T I, T N) { return __detail::reflect_impl(I, N); } -const inline float reflect(float I, float N) { +template +const inline __detail::enable_if_t< + __detail::is_arithmetic::Value && __detail::is_same::value, T> +reflect(T I, T N) { return __detail::reflect_impl(I, N); } template _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) -const inline vector reflect(vector I, vector N) { +const inline __detail::HLSL_FIXED_VECTOR reflect( + __detail::HLSL_FIXED_VECTOR I, + __detail::HLSL_FIXED_VECTOR N) { return __detail::reflect_vec_impl(I, N); } template -const inline vector reflect(vector I, vector N) { +const inline __detail::HLSL_FIXED_VECTOR +reflect(__detail::HLSL_FIXED_VECTOR I, + __detail::HLSL_FIXED_VECTOR N) { return __detail::reflect_vec_impl(I, N); } } // namespace hlsl diff --git a/clang/test/SemaHLSL/BuiltIns/distance-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/distance-errors.hlsl index e996bf5d2cb7c..e7521c7251432 100644 --- a/clang/test/SemaHLSL/BuiltIns/distance-errors.hlsl +++ b/clang/test/SemaHLSL/BuiltIns/distance-errors.hlsl @@ -3,8 +3,8 @@ float test_no_second_arg(float2 p0) { return distance(p0); // expected-error@-1 {{no matching function for call to 'distance'}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 1 was provided}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 1 was provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}} } @@ -12,22 +12,46 @@ float test_no_second_arg(float2 p0) { float test_too_many_arg(float2 p0) { return distance(p0, p0, p0); // expected-error@-1 {{no matching function for call to 'distance'}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 3 were provided}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 3 were provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}} } float test_double_inputs(double p0, double p1) { return distance(p0, p1); - // expected-error@-1 {{call to 'distance' is ambiguous}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} + // expected-error@-1 {{no matching function for call to 'distance'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} } float test_int_inputs(int p0, int p1) { return distance(p0, p1); - // expected-error@-1 {{call to 'distance' is ambiguous}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} + // expected-error@-1 {{no matching function for call to 'distance'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} +} + +float1 test_vec1_inputs(float1 p0, float1 p1) { + return distance(p0, p1); + // expected-error@-1 {{no matching function for call to 'distance'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float1]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float1]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 1]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 1]: no type named 'Type' in 'hlsl::__detail::enable_if'}} +} + +typedef float float5 __attribute__((ext_vector_type(5))); + +float5 test_vec5_inputs(float5 p0, float5 p1) { + return distance(p0, p1); + // expected-error@-1 {{no matching function for call to 'distance'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float5]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float5]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 5]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 5]: no type named 'Type' in 'hlsl::__detail::enable_if'}} } diff --git a/clang/test/SemaHLSL/BuiltIns/length-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/length-errors.hlsl index a191f0419fbba..92eca64e66bd2 100644 --- a/clang/test/SemaHLSL/BuiltIns/length-errors.hlsl +++ b/clang/test/SemaHLSL/BuiltIns/length-errors.hlsl @@ -4,8 +4,8 @@ void test_too_few_arg() { return length(); // expected-error@-1 {{no matching function for call to 'length'}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires single argument 'X', but no arguments were provided}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires single argument 'X', but no arguments were provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires single argument 'X', but no arguments were provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires single argument 'X', but no arguments were provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires single argument 'X', but no arguments were provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires single argument 'X', but no arguments were provided}} } @@ -14,40 +14,68 @@ void test_too_many_arg(float2 p0) { return length(p0, p0); // expected-error@-1 {{no matching function for call to 'length'}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires single argument 'X', but 2 arguments were provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires single argument 'X', but 2 arguments were provided}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires single argument 'X', but 2 arguments were provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires single argument 'X', but 2 arguments were provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires single argument 'X', but 2 arguments were provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires single argument 'X', but 2 arguments were provided}} } float double_to_float_type(double p0) { return length(p0); - // expected-error@-1 {{call to 'length' is ambiguous}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} + // expected-error@-1 {{no matching function for call to 'length'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = double]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = double]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: could not match '__detail::HLSL_FIXED_VECTOR' (aka 'vector<__detail::enable_if_t<(N > 1 && N <= 4), half>, N>') against 'double'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: could not match '__detail::HLSL_FIXED_VECTOR' (aka 'vector<__detail::enable_if_t<(N > 1 && N <= 4), float>, N>') against 'double'}} } float bool_to_float_type_promotion(bool p1) { return length(p1); - // expected-error@-1 {{call to 'length' is ambiguous}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} + // expected-error@-1 {{no matching function for call to 'length'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{andidate template ignored: substitution failure [with T = bool]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{andidate template ignored: substitution failure [with T = bool]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: could not match '__detail::HLSL_FIXED_VECTOR' (aka 'vector<__detail::enable_if_t<(N > 1 && N <= 4), half>, N>') against 'bool'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: could not match '__detail::HLSL_FIXED_VECTOR' (aka 'vector<__detail::enable_if_t<(N > 1 && N <= 4), float>, N>') against 'bool'}} } float length_int_to_float_promotion(int p1) { return length(p1); - // expected-error@-1 {{call to 'length' is ambiguous}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} + // expected-error@-1 {{no matching function for call to 'length'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = int]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = int]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: could not match '__detail::HLSL_FIXED_VECTOR' (aka 'vector<__detail::enable_if_t<(N > 1 && N <= 4), half>, N>') against 'int'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: could not match '__detail::HLSL_FIXED_VECTOR' (aka 'vector<__detail::enable_if_t<(N > 1 && N <= 4), float>, N>') against 'int'}} } float2 length_int2_to_float2_promotion(int2 p1) { return length(p1); - // expected-error@-1 {{call to 'length' is ambiguous}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} + // expected-error@-1 {{no matching function for call to 'length'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = int2]}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = int2]}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{1st parameter does not match adjusted type 'vector' of argument [with N = 2]}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{1st parameter does not match adjusted type 'vector' of argument [with N = 2]}} +} + +float1 test_vec1_inputs(float1 p0) { + return length(p0); + // expected-error@-1 {{no matching function for call to 'length'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float1]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float1]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 1]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 1]: no type named 'Type' in 'hlsl::__detail::enable_if'}} +} + +typedef float float5 __attribute__((ext_vector_type(5))); + +float5 test_vec5_inputs(float5 p0) { + return length(p0); + // expected-error@-1 {{no matching function for call to 'length'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float5]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float5]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 5]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 5]: no type named 'Type' in 'hlsl::__detail::enable_if'}} } diff --git a/clang/test/SemaHLSL/BuiltIns/reflect-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/reflect-errors.hlsl index 28cf992ed602b..9934a3e525d38 100644 --- a/clang/test/SemaHLSL/BuiltIns/reflect-errors.hlsl +++ b/clang/test/SemaHLSL/BuiltIns/reflect-errors.hlsl @@ -3,8 +3,8 @@ float test_no_second_arg(float2 p0) { return reflect(p0); // expected-error@-1 {{no matching function for call to 'reflect'}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 1 was provided}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 1 was provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}} } @@ -12,22 +12,46 @@ float test_no_second_arg(float2 p0) { float test_too_many_arg(float2 p0) { return reflect(p0, p0, p0); // expected-error@-1 {{no matching function for call to 'reflect'}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 3 were provided}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 2 arguments, but 3 were provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}} // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}} } float test_double_inputs(double p0, double p1) { return reflect(p0, p1); - // expected-error@-1 {{call to 'reflect' is ambiguous}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} + // expected-error@-1 {{no matching function for call to 'reflect'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} } float test_int_inputs(int p0, int p1) { return reflect(p0, p1); - // expected-error@-1 {{call to 'reflect' is ambiguous}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} - // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} + // expected-error@-1 {{no matching function for call to 'reflect'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}} +} + +float1 test_vec1_inputs(float1 p0, float1 p1) { + return reflect(p0, p1); + // expected-error@-1 {{no matching function for call to 'reflect'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float1]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float1]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with L = 1]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with L = 1]: no type named 'Type' in 'hlsl::__detail::enable_if'}} +} + +typedef float float5 __attribute__((ext_vector_type(5))); + +float5 test_vec5_inputs(float5 p0, float5 p1) { + return reflect(p0, p1); + // expected-error@-1 {{no matching function for call to 'reflect'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float5]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float5]: no type named 'Type' in 'hlsl::__detail::enable_if>'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with L = 5]: no type named 'Type' in 'hlsl::__detail::enable_if'}} + // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with L = 5]: no type named 'Type' in 'hlsl::__detail::enable_if'}} }