https://github.com/Adam-Warlock09 updated https://github.com/llvm/llvm-project/pull/235483
>From 4999d50d063ca595a114af4e2cd3a0864bb23b1b Mon Sep 17 00:00:00 2001 From: Rishika11052 <[email protected]> Date: Sun, 25 Oct 2026 16:32:13 +0000 Subject: [PATCH] [Clang][Sema] Add regression test for GH138098 --- clang/test/SemaCXX/gh138098.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 clang/test/SemaCXX/gh138098.cpp diff --git a/clang/test/SemaCXX/gh138098.cpp b/clang/test/SemaCXX/gh138098.cpp new file mode 100644 index 00000000000000..e06ecc1817a837 --- /dev/null +++ b/clang/test/SemaCXX/gh138098.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s + +template<typename T> struct Derived { + void f(int index) { + // expected-error@+3 {{explicit qualification required to use member 'type_c' from dependent base class}} + // expected-error@+2 {{comparison between pointer and integer ('int' and 'auto &(*)()')}} + // expected-note@8 {{in instantiation of member function 'Derived<int>::type_c' requested here}} + if (index != type_c<T>) {} + } + // expected-error@+2 {{cannot deduce return type 'auto &' for function with no return statements}} + // expected-note@12 {{member is declared here}} + static auto& type_c() { } +}; + +int main() { + Derived<int> d; + // expected-note@19 {{in instantiation of member function 'Derived<int>::f' requested here}} + // expected-note@19 {{in instantiation of member function 'Derived<int>::f' requested here}} + d.f(0); +} _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
