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
{{ message }}
Repository navigation
has_unique_object_representations returns false for classes whose base has only inherited members #327
Originally posted by jakub-labenski October 13, 2026
Issue Summary
type_has_unique_object_representations (folding.c) treats a direct base class as empty when its own field_list is NULL, ignoring the data inherited from its bases. Such a base contributes 0 bytes to the computed layout, so the tail-padding check fails and the trait wrongly evaluates to false.
Observed Behavior
Reproducer:
//remark:type_has_unique_object_representations
//options:--g++ --gnu_version=150100;fp
struct A { char i; };
struct B : A {};
struct C : B {};
static_assert(__has_unique_object_representations(B)); // passes
static_assert(__has_unique_object_representations(C)); // fails, expected to pass
edg-docker-test and then edg-test-run-diff returns:
--- Expected Output (sandbox/test.sft.rt.tar.gz -- edg_x86_64)
+++ Observed Output (sandbox/test.sft.rt.tar.gz -- edg_x86_64)
# fe_only -DTEST_NUMBER=1 --g++ --gnu_version=150100 Test_name.c
@@ -0,0 +1,5 @@
+"Test_name.c", line 7: error: static assertion failed
+ static_assert(__has_unique_object_representations(C)); // fails, expected to pass
+ ^
+
+1 error detected in the compilation of "Test_name.c".
Expected Behavior
Code should compile correctly.
Additional Details
No response
I acknowledge that:
I have checked open issues and existing discussions before filing this report.
@wchilders-nvidia@nv-cmeerw this looks fixed on main by 98ad882 (#326), and __has_unique_object_representations(C) from the report is now true. Could this be closed?
Activity
fix(folding): correct unique object rep checks [GH edgcpp#327]
fix(folding): correct unique object rep checks [GH edgcpp#327]
fix(folding): correct unique object rep checks [GH edgcpp#327]
Fix __has_unique_object_representations for several cases [GH edgcpp#327
Fix __has_unique_object_representations for several cases [GH edgcpp#327
Sync upstream main (ad4cfc4) into multibackend and reconcile build/ho…
mohitmishra786 commentedon Nov 14, 2026
@wchilders-nvidia @nv-cmeerw this looks fixed on main by 98ad882 (#326), and
__has_unique_object_representations(C)from the report is now true. Could this be closed?