1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // When built with modules, this test gives diagnostics like
10 // declaration of 'lerp' must be imported from module 'std.compat.cmath'
11 // before it is required
12 // therefore disable the test in this configuration.
13 // UNSUPPORTED: clang-modules-build
14
15 // <math.h>
16
17 // [support.c.headers.other]/1
18 // ... except for the functions described in [sf.cmath], the
19 // std::lerp function overloads ([c.math.lerp]) ...
20
21 #include <math.h>
22
f()23 void f() {
24 {
25 float f;
26 ::lerp(f, f, f); // expected-error {{no member named 'lerp' in the global namespace}}
27 std::lerp(f, f, f); // expected-error {{no member named 'lerp' in namespace 'std'}}
28 }
29 {
30 double d;
31 ::lerp(d, d, d); // expected-error {{no member named 'lerp' in the global namespace}}
32 std::lerp(d, d, d); // expected-error {{no member named 'lerp' in namespace 'std'}}
33 }
34 {
35 long double l;
36 ::lerp(l, l, l); // expected-error {{no member named 'lerp' in the global namespace}}
37 std::lerp(l, l, l); // expected-error {{no member named 'lerp' in namespace 'std'}}
38 }
39 }
40