Closed fangism closed 4 years ago
b/149945032
@tgorochowik since you implemented the original rule, could you take a look?
Recommendation: since an out-of-line definition is always followed by a forward declaration somewhere else (in this case inside a class), you could just ignore all out-of-line definitions (whose "names" are qualified) to avoid duplicate lint errors on the same name.
@fangism I am thinking about what would be the best way to do that.
Would that be okay to make GetSymbolIdentifierFromConstraintDeclaration
return a pointer instead of a reference and make it return nullptr
if it's dealing with an out-of-line definition? That would make the implementation pretty simple.
Ended up just adding an extra CST function to check whether a kConstraintDeclaration
is an out-of-line definition.
@fangism I am thinking about what would be the best way to do that.
~Would that be okay to make
GetSymbolIdentifierFromConstraintDeclaration
return a pointer instead of a reference and make it returnnullptr
if it's dealing with an out-of-line definition? That would make the implementation pretty simple.~Ended up just adding an extra CST function to check whether a
kConstraintDeclaration
is an out-of-line definition.
Simple enough.
Test case:
crashes: