[clang] [clang] Add test for CWG192 "Name lookup in parameters" (PR #121679)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 4 22:49:51 PST 2025


https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/121679

This patch adds a rather simple test for [CWG192](https://cplusplus.github.io/CWG/issues/192.html). Parameter declarations of member functions are not complete-class contexts (unlike default arguments), so the example in the issue is ill-formed. Changes in [CWG1352](https://cplusplus.github.io/CWG/issues/1352.html) which resolved the issue, are superseded by the notion of complete-class context (https://eel.is/c++draft/class.mem#def:complete-class_context).

>From 81948042d588a4bd2fe7bf0ada2f6794dec5e2b6 Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
Date: Sun, 5 Jan 2025 09:44:47 +0300
Subject: [PATCH] [clang] Add test for CWG192 "Name lookup in parameters"

---
 clang/test/CXX/drs/cwg1xx.cpp | 8 ++++++++
 clang/www/cxx_dr_status.html  | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/clang/test/CXX/drs/cwg1xx.cpp b/clang/test/CXX/drs/cwg1xx.cpp
index 6aec8b65c91f12..fb39da04b2df39 100644
--- a/clang/test/CXX/drs/cwg1xx.cpp
+++ b/clang/test/CXX/drs/cwg1xx.cpp
@@ -1347,6 +1347,14 @@ namespace cwg191 { // cwg191: yes
   }
 }
 
+namespace cwg192 { // cwg192: 2.7
+struct S {
+  void f(I i) { }
+  // expected-error at -1 {{unknown type name 'I'}}
+  typedef int I;
+};
+} // namespace cwg192
+
 // cwg193 is in cwg193.cpp
 
 namespace cwg194 { // cwg194: yes
diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index c069e155fd547c..68e2dcdf71253b 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -1197,7 +1197,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/192.html">192</a></td>
     <td>NAD</td>
     <td>Name lookup in parameters</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="full" align="center">Clang 2.7</td>
   </tr>
   <tr id="193">
     <td><a href="https://cplusplus.github.io/CWG/issues/193.html">193</a></td>



More information about the cfe-commits mailing list