[clang] [clang-tools-extra] [clang] Implement CWG2413 (implicit `typename` in conversion operators) (PR #195207)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Fri May 1 08:51:10 PDT 2026


================
@@ -8,6 +8,16 @@
 
 // cwg2406 is in cwg2406.cpp
 
+namespace cwg2413 { // cwg2413: 23
+#if __cplusplus >= 202002L
+template <typename T>
+struct S {
+  operator T::R();
+  void f() { operator T::R(); }
----------------
Endilll wrote:

This is missing extension warnings in language modes prior to C++20.

It's probably worth an extension warning in C++20 mode as well, because P1787R6 was a non-DR C++23 paper, but it seems like no other implementation warns on this in C++20 mode, probably because [P0634R3](https://wg21.link/p0634r3) "Down with `typename`!" was a C++20 paper: https://godbolt.org/z/sqEE48fsG

CC @AaronBallman 

https://github.com/llvm/llvm-project/pull/195207


More information about the cfe-commits mailing list