<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68702>68702</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Crash with modules and `constexpr` destructor
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:modules
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hahnjo
</td>
</tr>
</table>
<pre>
The following is a heavily reduced test case of `<vector>` in libstdc++ 13.2.0:
```c++
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: split-file %s %t
// RUN: %clang_cc1 -std=c++20 -emit-obj -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %t/main.cpp -o %t/main.o
//--- V.h
#ifndef V_H
#define V_H
class A {
public:
constexpr A() { }
constexpr ~A() { }
};
template <typename T>
class V {
public:
V() = default;
constexpr V(int n, const A& a = A()) {}
};
#endif
//--- inst1.h
#include "V.h"
static void inst1() {
V<int> v;
}
//--- inst2.h
#include "V.h"
static void inst2() {
V<int> v(100);
}
//--- module.modulemap
module "M" {
export *
module "V.h" {
export *
header "V.h"
}
module "inst1.h" {
export *
header "inst1.h"
}
}
module "inst2.h" {
export *
header "inst2.h"
}
//--- main.cpp
#include "V.h"
#include "inst2.h"
static void m() {
static V<int> v(100);
}
```
It crashes with
```
Unhandled cleanup; missing full expression marker?
UNREACHABLE executed at clang/lib/AST/ExprConstant.cpp:15617!
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVU2P2zgM_TXyhXBgS7EzOfiQT3SB3R667VwLRaJjTWXZkOR05rK_fSHbSZxJ2lksEMQJ-Sg-PdIkd04dDWJBsjXJthHvfNXYouKVeWmiQyPfiq8VQtlo3fxU5gjKAYcK-UnpN7AoO4ESPDoPgjuEpgSSJ4RtTih8YwnbkTwBZUCrg_NSELomdA0pm9FZQtiKJFuSrEJI_xn9o5XuCd3Dl2-fCVuBrSG2JRCa-Ufu-odU9pde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