[PATCH] D130511: [pseudo][wip] Eliminate simple-type-specifier ambiguities.

2022-07-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/lib/cxx/CXX.cpp:168 +bool guardPreviousTokenNotIdentifier(const GuardParams ) { + if (P.LookaheadIndex < 2) +return true; sammccall wrote: > Is LookaheadIndex from another patch? > I can't

[PATCH] D130511: [pseudo][wip] Eliminate simple-type-specifier ambiguities.

2022-07-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 448265. hokein marked an inline comment as done. hokein added a comment. address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130511/new/ https://reviews.llvm.org/D130511 Files:

[PATCH] D130511: [pseudo][wip] Eliminate simple-type-specifier ambiguities.

2022-07-26 Thread Sam McCall via Phabricator via cfe-commits
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 ) { + if (P.LookaheadIndex < 2) +return

[PATCH] D130511: [pseudo][wip] Eliminate simple-type-specifier ambiguities.

2022-07-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D130511#3679161 , @sammccall wrote: > TL;DR: I suspect this is valid but guarding `nested-name-specifier := :: > [guard=PrevNotIdentifier]` may be equivalent and clearer. Yeah, that's better! Repository: rG LLVM Github

[PATCH] D130511: [pseudo][wip] Eliminate simple-type-specifier ambiguities.

2022-07-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 447815. hokein added a comment. refine the patch: guard the "::" nested-name-specifier rule instead. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130511/new/ https://reviews.llvm.org/D130511 Files:

[PATCH] D130511: [pseudo][wip] Eliminate simple-type-specifier ambiguities.

2022-07-26 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. TL;DR: I suspect this is valid but guarding `nested-name-specifier := :: [guard=PrevNotIdentifier]` may be equivalent and clearer. In D130511#3678938 , @hokein wrote: > In D130511#3677423

[PATCH] D130511: [pseudo][wip] Eliminate simple-type-specifier ambiguities.

2022-07-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D130511#3677423 , @sammccall wrote: > My main concern here is that this might reject valid code (and if it doesn't, > it's not obvious why). > It does look like C++ forbids the cases I can come up with (e.g. trying to >

[PATCH] D130511: [pseudo][wip] Eliminate simple-type-specifier ambiguities.

2022-07-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. My main concern here is that this might reject valid code (and if it doesn't, it's not obvious why). It does look like C++ forbids the cases I can come up with (e.g. trying to provide a definition for `::Foo` is rejected by clang with "definition or redeclaration of

[PATCH] D130511: [pseudo][wip] Eliminate simple-type-specifier ambiguities.

2022-07-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. The solution is to favor the longest possible nest-name-specifier, and drop