aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorOleksandr T <oleksandr.tarasiuk@outlook.com>2024-06-21 15:18:14 +0300
committerGitHub <noreply@github.com>2024-06-21 08:18:14 -0400
commit9b50a88853cc5df4fcdcb56a2ea57f5db4b1978b (patch)
tree7e3809848359e6445362fed1c50c249f393ecb12 /clang/lib/Sema/SemaStmt.cpp
parent9c4944095db919580bdc698273065d1c91a98ed8 (diff)
downloadllvm-9b50a88853cc5df4fcdcb56a2ea57f5db4b1978b.zip
llvm-9b50a88853cc5df4fcdcb56a2ea57f5db4b1978b.tar.gz
llvm-9b50a88853cc5df4fcdcb56a2ea57f5db4b1978b.tar.bz2
[Clang] skip alignment checks on incomplete types to avoid an assertion failure while parsing lambda used as default argument (#94542)
Fixes #93512
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r--clang/lib/Sema/SemaStmt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 411e9af..1bb8638 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -3355,7 +3355,7 @@ Sema::NamedReturnInfo Sema::getNamedReturnInfo(const VarDecl *VD) {
// Variables with higher required alignment than their type's ABI
// alignment cannot use NRVO.
- if (!VD->hasDependentAlignment() &&
+ if (!VD->hasDependentAlignment() && !VDType->isIncompleteType() &&
Context.getDeclAlign(VD) > Context.getTypeAlignInChars(VDType))
Info.S = NamedReturnInfo::MoveEligible;