[PATCH] D157201: [Clang] Support qualified name as member designator in offsetof
Hubert Tong via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 9 16:21:59 PDT 2023
hubert.reinterpretcast added inline comments.
================
Comment at: clang/test/SemaCXX/offsetof.cpp:104
+struct X2 { int a; static int static_a; };
+int x2[__builtin_offsetof(struct X2, X2::a) == 0 ? 1 : -1];
+int x3[__builtin_offsetof(struct X2, X2::static_a) == 0 ? 1 : -1]; // expected-error{{no member named 'static_a'}}
----------------
Tests should include cases where the member is a direct member of a base class or an anonymous union therein (and named variously by the qualification with the base class name, the complete class name, an intermediate base class name, the base class name qualified with an intermediate base class, the base class name denoted using `::identity_t<Base>`, etc.).
Additionally, there should be a diagnostic test case where the qualifier is for an unrelated identically-defined class in another namespace.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157201/new/
https://reviews.llvm.org/D157201
More information about the cfe-commits
mailing list