[PATCH] D131683: Diagnosing the Future Keywords

Muhammad Usman Shahid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 11 07:58:43 PDT 2022


Codesbyusman added inline comments.


================
Comment at: clang/include/clang/Basic/TokenKinds.def:387
 // C++11 keywords
-CXX11_KEYWORD(alignas               , 0)
+CXX11_KEYWORD(alignas               , KEYC23)
 // alignof and _Alignof return the required ABI alignment
----------------
erichkeane wrote:
> Hmm... this looks like it is going to be troublesome for the 'future' feature.  Can you make sure you have tests for all of these?  
> Hmm... this looks like it is going to be troublesome for the 'future' feature.  Can you make sure you have tests for all of these?  

Yes working for the test cases


================
Comment at: clang/lib/Lex/Preprocessor.cpp:799
+#define C23_KEYWORD(NAME, FLAGS) .Case(#NAME, diag::warn_c23_keyword)
+#define CXX11_KEYWORD(NAME, FLAGS) .Case(#NAME, diag::warn_c23_keyword)
+#include "clang/Basic/TokenKinds.def"
----------------
erichkeane wrote:
> This isn't right at all.  We should be looking through the list of flags instead of trying to assume that cxx11 keywords here are all 'future' C keywords.  First, this isn't true.  Second, even if it was, it is really fragile.
> This isn't right at all.  We should be looking through the list of flags instead of trying to assume that cxx11 keywords here are all 'future' C keywords.  First, this isn't true.  Second, even if it was, it is really fragile

Yes I was looking to it, But not getting how to deal this.
Will need to make the different Case to access some of the keywords that are define in CXX11_KEYWORD.
Any suggestions?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131683/new/

https://reviews.llvm.org/D131683



More information about the cfe-commits mailing list