[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

Chandler Carruth chandlerc at google.com
Mon Aug 20 01:01:07 PDT 2012


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120820/9cc40f12/attachment.html>


More information about the cfe-commits mailing list