| 1 | // RUN: %clang_cc1 -x c++ -std=c++17 -fmodules -fmodules-local-submodule-visibility -fmodules-cache-path=%t %s -verify |
| 2 | |
| 3 | // expected-no-diagnostics |
| 4 | |
| 5 | #pragma clang module build PR38627 |
| 6 | module PR38627 {} |
| 7 | #pragma clang module contents |
| 8 | #pragma clang module begin PR38627 |
| 9 | namespace PR38627 { |
| 10 | struct X { |
| 11 | virtual ~X() {} |
| 12 | struct C { |
| 13 | friend X::~X(); |
| 14 | } c; |
| 15 | }; |
| 16 | } |
| 17 | #pragma clang module end |
| 18 | #pragma clang module endbuild |
| 19 | |
| 20 | #pragma clang module import PR38627 |
| 21 | |
| 22 | namespace PR38627 { |
| 23 | struct Y { |
| 24 | virtual ~Y() {} |
| 25 | struct C { |
| 26 | friend Y::~Y(); |
| 27 | } c; |
| 28 | }; |
| 29 | static_assert(noexcept(X().~X())); |
| 30 | static_assert(noexcept(Y().~Y())); |
| 31 | |
| 32 | struct A { virtual ~A() = default; }; |
| 33 | struct B : public A, public X { |
| 34 | virtual ~B() override = default; |
| 35 | }; |
| 36 | } // PR38627 |
| 37 | |