[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / clang / test / Modules / cxx17-exception-spec.cpp
blobba7be0e30d9c0bd8cc8812713f416d5f00443af4
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
4 module a {}
5 #pragma clang module contents
6 #pragma clang module begin a
7 constexpr bool return_true() { return true; }
8 struct X {
9 static void f() noexcept(return_true());
11 #pragma clang module end
12 #pragma clang module endbuild
14 #pragma clang module build b
15 module 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
29 // fail.
30 T t;
32 static_assert(noexcept(X().f()));
34 // expected-no-diagnostics