[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 6 06:15:56 PST 2025


=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/116708 at github.com>


================
@@ -7400,7 +7407,25 @@ bool DecomposePrintfHandler::GetSpecifiers(
       [](const EquatableFormatArgument &A, const EquatableFormatArgument &B) {
         return A.getPosition() < B.getPosition();
       });
-  return true;
+
+  // If there are duplicate positional arguments, ensure that they are all
+  // mutually compatible.
+  bool HadError = false;
+  auto ArgIter = Args.begin();
+  auto ArgEnd = Args.end();
+  while (ArgIter != ArgEnd) {
----------------
erichkeane wrote:

I don't have time to understand this yet... but this looks like it should be composible with some std/ADT algorithms, and should be.

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


More information about the cfe-commits mailing list