[clang] [Sema] Reject unqualified lookup of local nested class name (PR #192678)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 22 06:41:34 PDT 2026
================
@@ -0,0 +1,51 @@
+// RUN: %clang_cc1 -std=c++20 -verify %s
+
+struct A1 {
+ int x;
+ void f() { x = 1; } // OK
+};
+
+struct Base {
+ int y;
+};
+struct Derived : Base {
+ void f() { y = 2; } // OK
+};
+
+struct A2 { int z; };
+struct B2 : A2 {
+ using A2::z;
+ void f() { z = 3; } // OK
+};
+
+void pass1() {
----------------
Endilll wrote:
Tests from here on out can be twice as short if you combine them within a single function and reuse the definition of `A`, dropping differences in class-key (`class`/`struct`). I don't think it matters, and if you really want to test that, you need to add test cases for `union` as well.
https://github.com/llvm/llvm-project/pull/192678
More information about the cfe-commits
mailing list