================
@@ -1243,13 +1276,25 @@ class YAMLConverter {
 
     // Write all global functions.
     llvm::StringSet<> KnownNameOnlyFunctions;
+    llvm::StringSet<> KnownFunctionSelectors;
     for (const auto &Function : TLItems.Functions) {
       auto WhereParameters = getWhereParameters(Function);
       if (!WhereParameters.first)
         continue;
 
-      // Check for duplicate name-only global functions. Selector-aware
-      // duplicate diagnostics are handled by a later overload-matching PR.
+      if (WhereParameters.second) {
+        if (!KnownFunctionSelectors
+                 .insert(getFunctionSelectorKey(Function.Name,
+                                                *WhereParameters.second))
+                 .second) {
+          emitError(llvm::Twine("duplicate definition of global function '") +
----------------
j-hui wrote:

The wording of this diagnostic makes it sound like the _function_ was defined 
twice. Instead it should probably say something like:

> multiple APINotes entries for global function 'NAME' with Where.Parameters 
> [PARAMS]

https://github.com/llvm/llvm-project/pull/209408
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to