You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Clang] Non-polymorphic trivially relocatable types can have [[trivial_abi]] (#143111)
Use the definition of trivially relocatable types to short-circuit some
checks for trivial_abi.
Note that this is mostly a no-op as there is a lot of overlap between
trivial_abi and trivial relocatability (ie, I can't envision a scenario
in which there would be a trivially relocatable type that would not be
eligible for trivial_abi based on its special member function... which
is good!)
Note that for bases and members, we need to check CanPassInRegister
rather than just relocation. So we do these checks first, which leads to
better diagnostics.
struct__attribute__((trivial_abi)) S18 { // expected-warning {{'trivial_abi' cannot be applied to 'S18'}} expected-note {{copy constructors and move constructors are all deleted}}
168
+
struct__attribute__((trivial_abi)) S18 { // expected-warning {{'trivial_abi' cannot be applied to 'S18'}} \
169
+
// itanium-note {{'trivial_abi' is disallowed on 'S18' because it has a field of a non-trivial class type}} \
170
+
// windows-note {{'trivial_abi' is disallowed on 'S18' because it has a field of a non-trivial class type}} \
171
+
// scei-note {{'trivial_abi' is disallowed on 'S18' because its copy constructors and move constructors are all deleted}}
struct__attribute__((trivial_abi)) S19 { // expected-warning {{'trivial_abi' cannot be applied to 'S19'}} expected-note {{copy constructors and move constructors are all deleted}}
201
+
struct__attribute__((trivial_abi)) S19 { // expected-warning {{'trivial_abi' cannot be applied to 'S19'}} \
202
+
// itanium-note {{'trivial_abi' is disallowed on 'S19' because its copy constructors and move constructors are all deleted}} \
203
+
// windows-note {{'trivial_abi' is disallowed on 'S19' because it has a field of a non-trivial class type}} \
204
+
// scei-note {{'trivial_abi' is disallowed on 'S19' because its copy constructors and move constructors are all deleted}}
struct__attribute__((trivial_abi)) S18 { // expected-warning {{'trivial_abi' cannot be applied to 'S18'}} expected-note {{copy constructors and move constructors are all deleted}}
111
+
struct__attribute__((trivial_abi)) S18 { // expected-warning {{'trivial_abi' cannot be applied to 'S18'}} \
112
+
// expected-note {{'trivial_abi' is disallowed on 'S18' because it has a field of a non-trivial class type}}
0 commit comments