sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Nice!



================
Comment at: clang-tools-extra/pseudo/lib/cxx/CXX.cpp:168
+bool guardPreviousTokenNotIdentifier(const GuardParams &P) {
+  if (P.LookaheadIndex < 2)
+    return true;
----------------
Is LookaheadIndex from another patch?
I can't find it at head.

It seems a bit gratuitous here vs P.RHS.front()->startTokenIndex()... In 
general getting the info from RHS seems cleaner than jumping across by 
reasoning how many tokens it has




================
Comment at: clang-tools-extra/pseudo/lib/cxx/CXX.cpp:325
+      {(RuleID)Rule::nested_name_specifier_0coloncolon,
+       guardPreviousTokenNotIdentifier},
+
----------------
You could write this as `TOKEN_GUARD(coloncolon, Tok.prev().Kind != 
tok::identifier)`

If it's that short i like having the guard logic inline to avoid the 
indirection for the reader


================
Comment at: clang-tools-extra/pseudo/test/cxx/nested-name-specifier.cpp:18
+// CHECK:  statement~simple-declaration := decl-specifier-seq ;
+// CHECK-NOT: simple-declaration := decl-specifier-seq init-declarator-list ;
+}
----------------
Maybe check:
a<b>::c is ambiguous 3 ways, with a fixme to eliminate the one that is invalid. 
(I.e. the declaration of ::c)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130511

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to