[PATCH] D117416: Handle C variables with name that matches c++ access specifier
psigillito via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 15 20:46:44 PST 2022
psigillito added a comment.
Sorry, this is my first time using Phabricator. I am not sure if it matters that .arclint is changed in this review, it is not part of my commit.
This issue only appears to impact the accessSpecifier keywords. For example, a c variable declared with the name 'private' will be treated as an access specifier.
I tried to make parsing the identifiers more restrictive by requiring either an @ prefix for obj-c or a colon after the keyword for cpp. Unfortunately, that does not allow an incorrect access specifier (i.e without a colon) to be identified as an accessor. I think a missing colon is probably a common typo so I dont want to remove identifying a access specifier with a missing colon correctly.
I think the correct approach is to check if the var named 'private' is followed by an operator or symbol indicating it is variable.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117416/new/
https://reviews.llvm.org/D117416
More information about the cfe-commits
mailing list