1 // RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -fno-modules-error-recovery -fno-spell-checking -verify -std=c++17 %s
3 #pragma clang module build a
5 #pragma clang module contents
6 #pragma clang module begin a
7 constexpr bool return_true() { return true; }
9 static void f() noexcept(return_true());
11 #pragma clang module end
12 #pragma clang module endbuild
14 #pragma clang module build b
16 #pragma clang module contents
17 #pragma clang module begin b
18 #pragma clang module import a
19 using T
= decltype(return_true() && noexcept(X::f()));
20 #pragma clang module end
21 #pragma clang module endbuild
23 #pragma clang module import a
24 #pragma clang module import b
26 // Trigger import of return_true and then X::f in the same pass. This causes
27 // the type of X::f to be loaded while we have a pending body for return_true,
28 // which means evaluation of its exception specification at that point would
32 static_assert(noexcept(X().f()));
34 // expected-no-diagnostics