annotate clang/test/Modules/const-var-init-update.cpp @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -std=c++1z -fmodules %s -verify
anatofuz
parents:
diff changeset
2 // expected-no-diagnostics
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 #pragma clang module build std
anatofuz
parents:
diff changeset
5 module std { module limits {} module other {} }
anatofuz
parents:
diff changeset
6 #pragma clang module contents
anatofuz
parents:
diff changeset
7 #pragma clang module begin std.limits
anatofuz
parents:
diff changeset
8 template<typename T> struct numeric_limits {
anatofuz
parents:
diff changeset
9 static constexpr T __max = 5;
anatofuz
parents:
diff changeset
10 static constexpr T max() { return __max; }
anatofuz
parents:
diff changeset
11 };
anatofuz
parents:
diff changeset
12 #pragma clang module end
anatofuz
parents:
diff changeset
13 #pragma clang module begin std.other
anatofuz
parents:
diff changeset
14 inline void f() { numeric_limits<int> nl; }
anatofuz
parents:
diff changeset
15 #pragma clang module end
anatofuz
parents:
diff changeset
16 #pragma clang module endbuild
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 #pragma clang module build module_b
anatofuz
parents:
diff changeset
19 module module_b {}
anatofuz
parents:
diff changeset
20 #pragma clang module contents
anatofuz
parents:
diff changeset
21 #pragma clang module begin module_b
anatofuz
parents:
diff changeset
22 #pragma clang module import std.limits
anatofuz
parents:
diff changeset
23 constexpr int a = numeric_limits<int>::max();
anatofuz
parents:
diff changeset
24 #pragma clang module end
anatofuz
parents:
diff changeset
25 #pragma clang module endbuild
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 #pragma clang module import std.limits
anatofuz
parents:
diff changeset
28 #pragma clang module import module_b
anatofuz
parents:
diff changeset
29 constexpr int b = a;
anatofuz
parents:
diff changeset
30 static_assert(b == 5);