[cfe-commits] r162093 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/Analysis/stack-addr-ps.cpp test/SemaCXX/convert-to-bool.cpp test/SemaCXX/references.cpp test/SemaCXX/uninitialized.cpp

Hans Wennborg hans at chromium.org
Mon Aug 20 01:55:49 PDT 2012


Thanks, landed r162198.

 - Hans

On Mon, Aug 20, 2012 at 9:01 AM, Chandler Carruth <chandlerc at google.com> wrote:
> While I hope someone eventually comes up w/ better wording, I think this is
> an improvement. LGTM.
>
>
> On Fri, Aug 17, 2012 at 6:56 AM, Hans Wennborg <hans at chromium.org> wrote:
>>
>> On Fri, Aug 17, 2012 at 12:10 PM, Chandler Carruth <chandlerc at google.com>
>> wrote:
>> >> +namespace references {
>> >> +  int &a = a; // expected-warning{{variable 'a' is uninitialized when
>> >> used within its own initialization}}
>> >
>> > While completely correct (we are initializing the reference to an
>> > uninitialized reference), I wonder if this will confuse people into
>> > thinking
>> > there is some kind of copy or uninitialized *value* underlying the
>> > reference... Is there a better / more clear / more specific warning text
>> > we
>> > can use here?
>> >
>> > "reference 'a' not yet been bound to a value when used within its own
>> > initialization"?
>> > "reference 'a' is unbound when used within its own initialization"?
>>
>> I like your first suggestion and think it does make the warning
>> clearer. It annoys me slightly that we'd have to special-case
>> references when we output the diagnostic (it would look like in the
>> attached patch), but maybe that's not a big deal.
>>
>> Thanks,
>> Hans
>
>



More information about the cfe-commits mailing list