This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Fixed self assignment
ClosedPublic

Authored by xbolva00 on Apr 29 2019, 2:14 PM.

Diff Detail

Repository
rC Clang

Event Timeline

xbolva00 created this revision.Apr 29 2019, 2:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 29 2019, 2:14 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MyDeveloperDay added a comment.EditedMay 1 2019, 2:44 AM

Did this cause some issue? Does this fix something if so can we add a test, because maybe the line isn't needed

I would think we'd want to keep this as an identifier. we are just treating arg? the same as we would arg

RKSimon added a subscriber: RKSimon.

Did this cause some issue? Does this fix something if so can we add a test, because maybe the line isn't needed

I would think we'd want to keep this as an identifier. we are just treating arg? the same as we would arg

@MyDeveloperDay didn't you write this code in D58404?

Did this cause some issue? Does this fix something if so can we add a test, because maybe the line isn't needed

I would think we'd want to keep this as an identifier. we are just treating arg? the same as we would arg

@MyDeveloperDay didn't you write this code in D58404?

I did, but I think the correct code is to remove line 249 completely and not to set the token type to the question mark, unless there was an issue which suggested the otherway in which case it should be added as a test, but I think something like PVS-Studio was used to detect this as an issue but then actually the wrong assumption is being made as to what was intended. (which is more dangerous than the self assignment in the first place)

MyDeveloperDay requested changes to this revision.May 14 2019, 12:13 PM

please simply remove line 249

This revision now requires changes to proceed.May 14 2019, 12:13 PM
xbolva00 updated this revision to Diff 199494.May 14 2019, 12:43 PM

removed line

This revision is now accepted and ready to land.May 15 2019, 1:38 AM
This revision was automatically updated to reflect the committed changes.