Skip to content

Commit 6a6f9bf

Browse files
authored
[clang] Fix assertion failure when printing atomic apvalues (#85259)
When printing an `_Atomic(some struct type)`, we would later run into an assertion because we do a `Ty->castAs<RecordType>()`, which doesn't work with an `AtomicType`.
1 parent 6ff6191 commit 6a6f9bf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/AST/APValue.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,9 @@ void APValue::printPretty(raw_ostream &Out, const PrintingPolicy &Policy,
704704
return;
705705
}
706706

707+
if (const auto *AT = Ty->getAs<AtomicType>())
708+
Ty = AT->getValueType();
709+
707710
switch (getKind()) {
708711
case APValue::None:
709712
Out << "<out of lifetime>";

0 commit comments

Comments
 (0)