================
@@ -6118,6 +6120,10 @@ void Sema::warnOnReservedIdentifier(const NamedDecl *D) {
     Diag(D->getLocation(), diag::warn_reserved_extern_symbol)
         << D << static_cast<int>(Status);
   }
+  // Diagnose use of C++ keywords in C as being incompatible with C++.
+  if (const IdentifierInfo *II = D->getIdentifier();
----------------
zygoloid wrote:

Is there a reason to warn on this here rather than in the same place we warn on 
"future keywords"? (When the preprocessor produces the final identifier token.) 
I would worry that this check would miss some cases. (Parameter names appear to 
need special handling, and they're probably not going to remain the only case 
even if they currently are.)

https://github.com/llvm/llvm-project/pull/137234
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to