1 // RUN: %clang_cc1 -fallow-pch-with-compiler-errors -std=c++20 -x c++-header -emit-pch %s -o %t -verify
2 // RUN: %clang_cc1 -fallow-pch-with-compiler-errors -std=c++20 -include-pch %t %s -verify
6 #include "bad_include.h"
7 // expected-error@6{{'bad_include.h' file not found}}
9 template <bool, class = void> struct enable_if
{};
10 template <class T
> struct enable_if
<true, T
> { typedef T type
; };
11 template <bool B
, class T
= void> using enable_if_t
= typename enable_if
<B
, T
>::type
;
13 template <typename
> struct meta
{ static constexpr int value
= 0; };
14 template <> struct meta
<int> { static constexpr int value
= 1; };
15 template <> struct meta
<float> { static constexpr int value
= 2; };
18 inline namespace inner
{
21 constexpr enable_if_t
<meta
<T
>::value
== 0, void> midpoint(T
) {}
24 constexpr enable_if_t
<meta
<U
>::value
== 1, void> midpoint(U
) {}
27 constexpr enable_if_t
<meta
<F
>::value
== 2, void> midpoint(F
) {}
34 // expected-error@27{{'N::midpoint' has different definitions in different modules; defined here first difference is 1st parameter with type 'F'}}
35 // expected-error@24{{'N::midpoint' has different definitions in different modules; defined here first difference is 1st parameter with type 'U'}}
36 // expected-note@21{{but in '' found 1st parameter with type 'T'}}
38 // expected-error@37{{no member named 'something' in namespace 'N'}}
39 // expected-note@21{{but in '' found 1st parameter with type 'T'}}