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

Carlos Alberto Enciso via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 2 02:06:14 PDT 2018


CarlosAlbertoEnciso added a comment.

In https://reviews.llvm.org/D46190#1083502, @rsmith wrote:

> This is already the correct outcome. Both typedefs are referenced; this is correct because they are named by the source code. Neither typedef is marked as "used"; this is correct because a typedef cannot be odr-used.


I appreciate very much your explanations on the typedef case.

My misunderstanding comes from my experience with a commercial C/C++ front-end, which has the concept of 'needed' and 'really needed' and those concepts seems different to the 'referenced' and 'used' in Clang. I was trying to match that concept:

needed -> referenced.
really needed -> used.


Repository:
  rC Clang

https://reviews.llvm.org/D46190





More information about the cfe-commits mailing list