PR gdb/28480: Improve ambiguous member detection
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / ambiguous.exp
index 008898c58188fc13c4b97022855f6b7068b84745..1e63dc0c5dc699e3456c3344577a579c1b680cd5 100644 (file)
@@ -264,3 +264,13 @@ gdb_test "print (A1)(KV)jva1" " = \{x = 3, y = 4\}"
 # JVA1V is derived from A1; A1 is a virtual base indirectly
 # and also directly; must not report ambiguity when a JVA1V is cast to an A1.
 gdb_test "print (A1)jva1v" " = {x = 1, y = 2}"
+
+# C++20 introduced a way to have ambiguous fields with the same byte offset.
+# This class explicitly tests for that.
+# if this is tested with a compiler that can't handle [[no_unique_address]]
+# the code should still correctly identify the ambiguity because of
+# different byte offsets.
+test_ambiguous "je.x" "x" "JE" {
+    "'int A1::x' (JE -> A1)"
+    "'empty A4::x' (JE -> A4)"
+}
This page took 0.024834 seconds and 4 git commands to generate.