File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,8 @@ Bug Fixes to C++ Support
265
265
- No longer reject valid use of the ``_Alignas `` specifier when declaring a
266
266
local variable, which is supported as a C11 extension in C++. Previously, it
267
267
was only accepted at namespace scope but not at local function scope.
268
+ - Clang no longer tries to call consteval constructors at runtime when they appear in a member initializer.
269
+ (`#782154 <https://github.com/llvm/llvm-project/issues/82154>`_`)
268
270
269
271
Bug Fixes to AST Handling
270
272
^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -6201,6 +6201,12 @@ struct ImmediateCallVisitor : public RecursiveASTVisitor<ImmediateCallVisitor> {
6201
6201
return RecursiveASTVisitor<ImmediateCallVisitor>::VisitStmt(E);
6202
6202
}
6203
6203
6204
+ bool VisitCXXConstructExpr(CXXConstructExpr *E) {
6205
+ if (const FunctionDecl *FD = E->getConstructor())
6206
+ HasImmediateCalls |= FD->isImmediateFunction();
6207
+ return RecursiveASTVisitor<ImmediateCallVisitor>::VisitStmt(E);
6208
+ }
6209
+
6204
6210
// SourceLocExpr are not immediate invocations
6205
6211
// but CXXDefaultInitExpr/CXXDefaultArgExpr containing a SourceLocExpr
6206
6212
// need to be rebuilt so that they refer to the correct SourceLocation and
Original file line number Diff line number Diff line change @@ -258,3 +258,20 @@ void void_call() { // EVAL-FN-LABEL: define {{.*}} @_Z9void_call
258
258
void_test ();
259
259
// EVAL-FN: {{^}}}
260
260
}
261
+
262
+
263
+ namespace GH82154 {
264
+ struct S1 { consteval S1 (int ) {} };
265
+ struct S3 { constexpr S3 (int ) {} };
266
+
267
+ void f () {
268
+ struct S2 {
269
+ S1 s = 0 ;
270
+ S3 s2 = 0 ;
271
+ };
272
+ S2 s;
273
+ // EVAL-FN-LABEL: define {{.*}} void @_ZZN7GH821541fEvEN2S2C2Ev
274
+ // EVAL-FN-NOT: call void @_ZN7GH821542S1C2Ei
275
+ // EVAL-FN: call void @_ZN7GH821542S3C2Ei
276
+ }
277
+ }
You can’t perform that action at this time.
0 commit comments