[PATCH] D46190: For an ODR declaration, set the 'Used' bit on its associated declarations.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 27 16:07:09 PDT 2018


rsmith requested changes to this revision.
rsmith added a comment.
This revision now requires changes to proceed.

No, absolutely not. This would be insanely expensive, and marks entirely unrelated things "used".

The right thing to do here is to consistently track both the named declaration (the one found by name lookup, which might be a using-declaration) and the ultimately selected declaration (which might be the target of the using-declaration, or if that declaration is a template, a specialization of that template), and pass both to `MarkAnyDeclUsed`. Then we should mark the named declaration as `Referenced` and the selected declaration as `Used`. (The "unused using-declaration" warning should be based on the `Referenced` bit, since it's not meaningful to odr-use a using-declaration.)


Repository:
  rC Clang

https://reviews.llvm.org/D46190





More information about the cfe-commits mailing list