[clang] [APINotes] Diagnose invalid Where.Parameters selectors (PR #209408)

John Hui via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 23 18:50:17 PDT 2026


================
@@ -1162,11 +1182,24 @@ class YAMLConverter {
       Writer.addField(TagCtxID, Field.Name, FI, SwiftVersion);
     }
 
+    llvm::StringSet<> KnownMethodSelectors;
     for (const auto &CXXMethod : T.Methods) {
       auto WhereParameters = getWhereParameters(CXXMethod);
       if (!WhereParameters.first)
         continue;
 
+      if (WhereParameters.second) {
+        if (!KnownMethodSelectors
+                 .insert(getFunctionSelectorKey(CXXMethod.Name,
+                                                *WhereParameters.second))
+                 .second) {
+          emitError(llvm::Twine("duplicate definition of C++ method '") +
----------------
j-hui wrote:

Same comment here as for global definitions

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


More information about the cfe-commits mailing list