-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[clang][Interp][NFC] Add a failing test case #102801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) ChangesFull diff: https://github.com/llvm/llvm-project/pull/102801.diff 1 Files Affected:
diff --git a/clang/test/AST/Interp/cxx20.cpp b/clang/test/AST/Interp/cxx20.cpp
index 27dbd2818be60..389d9d883725f 100644
--- a/clang/test/AST/Interp/cxx20.cpp
+++ b/clang/test/AST/Interp/cxx20.cpp
@@ -858,3 +858,47 @@ namespace DefinitionLoc {
constexpr NonConstexprCopy ncc2 = ncc1; // both-error {{constant expression}} \
// both-note {{non-constexpr constructor}}
}
+
+/// FIXME: Call base dtors when explicitly calling dtor.
+namespace VirtDtor {
+ class B {
+ public:
+ constexpr B(char *p) : p(p) {}
+ virtual constexpr ~B() {
+ *p = 'B';
+ ++p;
+ }
+
+ char *p;
+ };
+
+ class C : public B {
+ public:
+ constexpr C(char *p) : B(p) {}
+ virtual constexpr ~C() override {
+ *p = 'C';
+ ++p;
+ }
+ };
+
+ union U {
+ constexpr U(char *p) : c(p) {}
+ constexpr ~U() {}
+
+ C c;
+ };
+
+ constexpr int test(char a, char b) {
+ char buff[2] = {};
+ U u(buff);
+
+ /// U is a union, so it won't call the destructor of its fields.
+ /// We do this manually here. Explicitly calling ~C() here should
+ /// also call the destructor of the base classes however.
+ u.c.~C();
+
+ return buff[0] == a && buff[1] == b;
+ }
+
+ static_assert(test('C', 'B')); // expected-error {{failed}}
+}
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/141/builds/1466 Here is the relevant piece of the build log for the reference:
|
No description provided.