llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Aman Maurya (amanmaurya92)
<details>
<summary>Changes</summary>
### Summary
Fixes CI test failures introduced in #<!-- -->219288:
- In `clang/test/AST/ByteCode/records.cpp`, resolves the existing `FIXME: See
#<!-- -->85601` by updating `static_assert(discarded() == 1)` to
`static_assert(discarded() == 0)` now that temporary destruction timing in
aggregate default member initialization is fixed.
- In `clang/test/SemaCXX/aggregate-default-member-initializers.cpp`, removes
outdated `bytecode-error` and `bytecode-note` annotations in the `lifetime`
namespace that caused `-verify` failures ("diagnostics expected but not seen")
under `-fexperimental-new-constant-interpreter`.
Fixes build breakages on `main` affecting pre-merge CI across subsequent PRs.
Cc: @<!-- -->yronglin
---
Full diff: https://github.com/llvm/llvm-project/pull/224389.diff
2 Files Affected:
- (modified) clang/test/AST/ByteCode/records.cpp (+4-6)
- (modified) clang/test/SemaCXX/aggregate-default-member-initializers.cpp
(+4-10)
``````````diff
diff --git a/clang/test/AST/ByteCode/records.cpp
b/clang/test/AST/ByteCode/records.cpp
index daba582f82fb5c..39d2b948ee59fa 100644
--- a/clang/test/AST/ByteCode/records.cpp
+++ b/clang/test/AST/ByteCode/records.cpp
@@ -1315,12 +1315,10 @@ namespace {
return x;
}
- /// Before the result object was allocated, this could not be evaluated at
- /// all. The temporary 'B' is not destroyed until the end of the enclosing
- /// full-expression, so 'x' still reads 1 here, matching legacy evaluator.
- ///
- /// FIXME: See https://github.com/llvm/llvm-project/issues/85601.
- static_assert(discarded() == 1);
+ /// The temporary 'A' created by the default member initializer is destroyed
+ /// at the end of the full-expression containing the aggregate initialization
+ /// (see https://github.com/llvm/llvm-project/issues/85601).
+ static_assert(discarded() == 0);
/// A const-qualified composite result is writable while under construction.
constexpr int decrement(int &x) {
diff --git a/clang/test/SemaCXX/aggregate-default-member-initializers.cpp
b/clang/test/SemaCXX/aggregate-default-member-initializers.cpp
index 9a004ea79d84a2..27fb4deab77d64 100644
--- a/clang/test/SemaCXX/aggregate-default-member-initializers.cpp
+++ b/clang/test/SemaCXX/aggregate-default-member-initializers.cpp
@@ -17,10 +17,7 @@ struct AA {
struct B {
int &x;
- // FIXME: The new constant interpreter does not give a discarded composite
- // prvalue a result object, so the default member initializer cannot read
- // 'x'. This predates this change; the legacy interpreter gets it right.
- const A &a = A{x}; // bytecode-note 3{{implicit use of 'this' pointer is
only allowed within the evaluation of a call to a 'constexpr' member function}}
+ const A &a = A{x};
};
struct BB {
@@ -46,12 +43,9 @@ constexpr int paren() {
return x;
}
-static_assert(one() == 0); // bytecode-error {{static assertion expression is
not an integral constant expression}} \
- // bytecode-note {{in call to 'one()'}}
-static_assert(two() == 0); // bytecode-error {{static assertion expression is
not an integral constant expression}} \
- // bytecode-note {{in call to 'two()'}}
-static_assert(paren() == 0); // bytecode-error {{static assertion expression
is not an integral constant expression}} \
- // bytecode-note {{in call to 'paren()'}}
+static_assert(one() == 0);
+static_assert(two() == 0);
+static_assert(paren() == 0);
} // namespace lifetime
``````````
</details>
https://github.com/llvm/llvm-project/pull/224389
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits