vingeldal added a comment.
Herald added a subscriber: wuzish.

After looking in to it I got less certain of where the error lies and 
eventually I got uncertain if this even is a false negative, so I started out 
with just posting a change where the unit test is updated to detect the issue.
This is just to have a start for a discussion of how this should actually work 
and what is the best way forward.

The purpose of the rule is to avoid code which causes hidden dependencies. The 
given example of a potential false positive is a free function with a static 
variable.
Now, wouldn't a static variable inside a function body make the function 
stateful thereby risking that the function gives different results for the same 
input, in ways that might look arbitrary or random to the caller.
I think that might actually be a good example of what the rule is meant to 
prevent so maybe this isn't a false positive after all?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77461



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

Reply via email to