summaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api/debugger
diff options
context:
space:
mode:
authorKrystian Stasiowski <sdkrystian@gmail.com>2024-05-20 14:44:59 -0400
committerGitHub <noreply@github.com>2024-05-20 14:44:59 -0400
commitacf5ad2a4ed9bf94b03d18ccddce7710e721dc6c (patch)
treec053b48bd55568f2841a0dc559dc888c63674d93 /lldb/test/API/python_api/debugger
parentbce3680f45b57f6ce745cb7da659f2ece745a1d1 (diff)
[Clang][Sema] Diagnose current instantiation used as an incomplete base class (#92597)
Consider the following: ``` template<typename T> struct A { struct B : A { }; }; ``` According to [class.derived.general] p2: > [...] A _class-or-decltype_ shall denote a (possibly cv-qualified) class type that is not an incompletely defined class; any cv-qualifiers are ignored. [...] Although GCC and EDG rejects this, Clang accepts it. This is incorrect, as `A` is incomplete within its own definition (outside of a complete-class context). This patch correctly diagnoses instances where the current instantiation is used as a base class before it is complete. Conversely, Clang erroneously rejects the following: ``` template<typename T> struct A { struct B; struct C : B { }; struct B : C { }; // error: circular inheritance between 'C' and 'A::B' }; ``` Though it may seem like no valid specialization of this template can be instantiated, an explicit specialization of either member classes for an implicit instantiated specialization of `A` would permit the definition of the other member class to be instantiated, e.g.: ``` template<> struct A<int>::B { }; A<int>::C c; // ok ``` So this patch also does away with this error. This means that circular inheritance is diagnosed during instantiation of the definition as a consequence of requiring the base class type to be complete (matching the behavior of GCC and EDG).
Diffstat (limited to 'lldb/test/API/python_api/debugger')
0 files changed, 0 insertions, 0 deletions