[clang] [Clang][Lex] Implement CWG3013: Error if #embed parameters were defined as macros (PR #224769)

Ian Li via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 22 16:46:12 PDT 2026


================
@@ -879,6 +880,11 @@ void Preprocessor::updateOutOfDateIdentifier(const IdentifierInfo &II) const {
   getExternalSource()->updateOutOfDateIdentifier(II);
 }
 
+static bool isProtectedEmbedParameterName(const IdentifierInfo *II) {
+  return II->isStr("limit") || II->isStr("prefix") || II->isStr("suffix") ||
+         II->isStr("if_empty");
----------------
ianayl wrote:

Admittedly I had copied what I saw other functions do, but you're right in that this isn't very clean. I've put a list of identifiers in [PPEmbedParameters.h](https://github.com/llvm/llvm-project/pull/224769/changes#diff-6fc5efcab63f4c2655b75f9c4f080f43a890ec9c2b20602604a332d013f1771cR22) along with other embed parameter class definitions instead.

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


More information about the cfe-commits mailing list