File tree Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -637,6 +637,9 @@ Bug Fixes in This Version
637637- Fix crash during code generation of C++ coroutine initial suspend when the return
638638 type of await_resume is not trivially destructible.
639639 Fixes (`#63803 <https://github.com/llvm/llvm-project/issues/63803 >`_)
640+ - ``__is_trivially_relocatable `` no longer returns true for non-object types
641+ such as references and functions.
642+ Fixes (`#67498 <https://github.com/llvm/llvm-project/issues/67498 >`_)
640643- Fix crash when the object used as a ``static_assert `` message has ``size `` or ``data `` members
641644 which are not member functions.
642645- Support UDLs in ``static_assert `` message.
Original file line number Diff line number Diff line change @@ -2649,6 +2649,8 @@ bool QualType::isTriviallyRelocatableType(const ASTContext &Context) const {
26492649
26502650 if (BaseElementType->isIncompleteType ()) {
26512651 return false ;
2652+ } else if (!BaseElementType->isObjectType ()) {
2653+ return false ;
26522654 } else if (const auto *RD = BaseElementType->getAsRecordDecl ()) {
26532655 return RD->canPassInRegisters ();
26542656 } else {
Original file line number Diff line number Diff line change 11// RUN: %clang_cc1 -fsyntax-only -verify %s
22
3- struct S ; // expected-note 2 {{forward declaration of 'S'}}
3+ struct S ; // expected-note 6 {{forward declaration of 'S'}}
44
55void f () {
66 __is_pod (S); // expected-error{{incomplete type 'S' used in type trait expression}}
77 __is_pod (S[]); // expected-error{{incomplete type 'S' used in type trait expression}}
8+
9+ __is_trivially_copyable (S); // expected-error{{incomplete type 'S' used in type trait expression}}
10+ __is_trivially_copyable (S[]); // expected-error{{incomplete type 'S' used in type trait expression}}
11+
12+ __is_trivially_relocatable (S); // expected-error{{incomplete type 'S' used in type trait expression}}
13+ __is_trivially_relocatable (S[]); // expected-error{{incomplete type 'S' used in type trait expression}}
814}
Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2+ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
3+
4+ // expected-no-diagnostics
5+
6+ static_assert (!__is_pod(void ), " " );
7+ static_assert (!__is_pod(int &), " " );
8+ static_assert (!__is_pod(int ()), " " );
9+
10+ static_assert (!__is_trivially_copyable(void ), " " );
11+ static_assert (!__is_trivially_copyable(int &), " " );
12+ static_assert (!__is_trivially_copyable(int ()), " " );
13+
14+ static_assert (!__is_trivially_relocatable(void ), " " );
15+ static_assert (!__is_trivially_relocatable(int &), " " );
16+ static_assert (!__is_trivially_relocatable(int ()), " " );
You can’t perform that action at this time.
0 commit comments