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
637
637
- Fix crash during code generation of C++ coroutine initial suspend when the return
638
638
type of await_resume is not trivially destructible.
639
639
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 >`_)
640
643
- Fix crash when the object used as a ``static_assert `` message has ``size `` or ``data `` members
641
644
which are not member functions.
642
645
- 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 {
2649
2649
2650
2650
if (BaseElementType->isIncompleteType ()) {
2651
2651
return false ;
2652
+ } else if (!BaseElementType->isObjectType ()) {
2653
+ return false ;
2652
2654
} else if (const auto *RD = BaseElementType->getAsRecordDecl ()) {
2653
2655
return RD->canPassInRegisters ();
2654
2656
} else {
Original file line number Diff line number Diff line change 1
1
// RUN: %clang_cc1 -fsyntax-only -verify %s
2
2
3
- struct S ; // expected-note 2 {{forward declaration of 'S'}}
3
+ struct S ; // expected-note 6 {{forward declaration of 'S'}}
4
4
5
5
void f () {
6
6
__is_pod (S); // expected-error{{incomplete type 'S' used in type trait expression}}
7
7
__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}}
8
14
}
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