Debian Codegraph @

clang/test/PCH/default-argument-with-immediate-calls.cpp

raw
1 // RUN: %clang_cc1 -std=c++20 -emit-pch %s -o %t
2 // RUN: %clang_cc1 -std=c++20 -include-pch %t -verify %s
3 // expected-no-diagnostics
4
5 #ifndef HEADER_INCLUDED
6 #define HEADER_INCLUDED
7
8 consteval int immediate();
9 int regular_function() {
10 return 0;
11 }
12
13 struct S {
14 int a = immediate() + regular_function();
15 };
16
17 int f(int arg = immediate()) {
18 return arg;
19 }
20
21 #else
22
23 consteval int immediate() {
24 return 0;
25 }
26
27 void test() {
28 f(0);
29 f();
30 S s{0};
31 S t{0};
32 }
33
34 #endif