On Dec 6, 2010, at 2:48 PM, John McCall wrote:
> On Dec 6, 2010, at 2:34 PM, Douglas Gregor wrote:
>> On Dec 6, 2010, at 10:33 AM, John McCall wrote:
>>> It could be dependent if we implemented overloading on it. :)
>>>
>>> I'm not sure why __attribute__((cleanup("foo"))) is different from, say, an
>>> explicit call to (foo)(x), or &foo. In all of these cases, from the user's
>>> perspective the function is used, because their code probably won't compile
>>> if you remove the declaration. So you should still use
>>> MarkDeclarationReferenced, and if we want to teach
>>> MarkDeclarationReferenced about this user notion of a dependent use, we've
>>> got one place to change.
>>
>> I disagree with "from the user's perspective the function is used". The
>> function declaration is needed, sure, but that's very different from "used"
>> in the ODR sense, which implies that we need to have a definition. And I
>> think that user's don't expect to need definitions for something that's only
>> used in an uninstantiated template.
>
> Right, so we clearly wouldn't want this "user" sense of "used" to cause
> instantiation, much less code emission. But it would be nice for
> -Wunused-function not to suggest removing function definitions when doing so
> will cause the code to stop compiling.
I agree.
- Doug
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits