Nice!
On Tue, Feb 7, 2017 at 7:30 PM, Saleem Abdulrasool via cfe-commits <
cfe-commits@lists.llvm.org> wrote:
> Author: compnerd
> Date: Tue Feb 7 21:30:13 2017
> New Revision: 294401
>
> URL: http://llvm.org/viewvc/llvm-project?rev=294401=rev
> Log:
> Sema: add warn
Author: compnerd
Date: Tue Feb 7 21:30:13 2017
New Revision: 294401
URL: http://llvm.org/viewvc/llvm-project?rev=294401=rev
Log:
Sema: add warning for c++ member variable shadowing
Add a warning for shadowed variables across records. Referencing a
shadow'ed variable may not give the desired
On 2/7/17 7:30 PM, Saleem Abdulrasool wrote:
On Tue, Feb 7, 2017 at 1:09 PM, Jonathan Roelofs
> wrote:
On 1/24/17 8:10 PM, Saleem Abdulrasool via cfe-commits wrote:
Don't use the cast for the check, use isa.
On Tue, Feb 7, 2017 at 1:09 PM, Jonathan Roelofs
wrote:
>
>
> On 1/24/17 8:10 PM, Saleem Abdulrasool via cfe-commits wrote:
>
>> Don't use the cast for the check, use isa. Although, since you use the
>> value later, it is probably better to write this as:
>>
>> if
On 1/24/17 8:10 PM, Saleem Abdulrasool via cfe-commits wrote:
Don't use the cast for the check, use isa. Although, since you use the
value later, it is probably better to write this as:
if (const auto *RD = cast(CurContext))
CheckShadowInheritedVariabless(Loc, Name.getAsString(),
> James
>
>
>
> *From: *<meta...@gmail.com> on behalf of Richard Smith <
> rich...@metafoo.co.uk>
> *Date: *Saturday, February 4, 2017 at 10:43 PM
> *To: *James Sun <james...@fb.com>
> *Cc: *Saleem Abdulrasool <compn...@compnerd.org>, "
&
asool <compn...@compnerd.org>, "cfe-commits@lists.llvm.org"
<cfe-commits@lists.llvm.org>, Aaron Ballman <aa...@aaronballman.com>
Subject: Re: Add warning for c++ member variable shadowing
Thanks Richard! Hopefully this is the last patch :D
Could you please help me to comm
Abdulrasool <compn...@compnerd.org>, "cfe-commits@lists.llvm.org"
<cfe-commits@lists.llvm.org>, Aaron Ballman <aa...@aaronballman.com>
Subject: Re: Add warning for c++ member variable shadowing
Thanks, just one more thing I noticed (sorry!) and this looks good to go.
+d
gt; cfe-commits@lists.llvm.org" <cfe-commits@lists.llvm.org>, Aaron Ballman <
> aa...@aaronballman.com>
> *Subject: *Re: Add warning for c++ member variable shadowing
>
>
>
> updated
>
>
>
> *From: *James Sun <james...@fb.com>
> *Date: *Sa
ists.llvm.org"
<cfe-commits@lists.llvm.org>, Aaron Ballman <aa...@aaronballman.com>
Subject: Re: Add warning for c++ member variable shadowing
Ok I get your point. Suppose there are two paths from class B to base class A.
One is with access as_none; the other is as_public. Then there
fe-commits@lists.llvm.org<mailto:cfe-commits@lists.llvm.org>>, Aaron Ballman
<aa...@aaronballman.com<mailto:aa...@aaronballman.com>>
Subject: Re: Add warning for c++ member variable shadowing
Thanks, James! I think I have only one more substantive comment:
+ (Field-&g
com>>
Cc: Saleem Abdulrasool <compn...@compnerd.org<mailto:compn...@compnerd.org>>,
"cfe-commits@lists.llvm.org<mailto:cfe-commits@lists.llvm.org>"
<cfe-commits@lists.llvm.org<mailto:cfe-commits@lists.llvm.org>>, Aaron Ballman
<aa...@aaronb
vm.org>"
<cfe-commits@lists.llvm.org<mailto:cfe-commits@lists.llvm.org>>, Aaron Ballman
<aa...@aaronballman.com<mailto:aa...@aaronballman.com>>
Subject: Re: Add warning for c++ member variable shadowing
Thanks, James! I think I have only one more substantive comment:
Date: *Thursday, February 2, 2017 at 11:59 AM
> *To: *James Sun <james...@fb.com>
> *Cc: *Saleem Abdulrasool <compn...@compnerd.org>, "
> cfe-commits@lists.llvm.org" <cfe-commits@lists.llvm.org>, Aaron Ballman <
> aa...@aaronballman.com>
> *Subject:
rd.org>, "cfe-commits@lists.llvm.org"
<cfe-commits@lists.llvm.org>, Aaron Ballman <aa...@aaronballman.com>
Subject: Re: Add warning for c++ member variable shadowing
Thanks, James! I think I have only one more substantive comment:
+ (Field->getAccess() == AS_public ||
n behalf of Richard Smith <
> rich...@metafoo.co.uk>
> *Date: *Wednesday, February 1, 2017 at 3:50 PM
> *To: *James Sun <james...@fb.com>
>
> *Cc: *Saleem Abdulrasool <compn...@compnerd.org>, "
> cfe-commits@lists.llvm.org" <cfe-commits@lists.llvm.org
rd.org>, "cfe-commits@lists.llvm.org"
<cfe-commits@lists.llvm.org>, Aaron Ballman <aa...@aaronballman.com>
Subject: Re: Add warning for c++ member variable shadowing
+ std::set bases;
+const auto baseName =
Specifier->getType()->getAsCXXRecordDecl()->getName();
Ple
>
> *To: *James Sun <james...@fb.com>
> *Cc: *Richard Smith <rich...@metafoo.co.uk>, "cfe-commits@lists.llvm.org"
> <cfe-commits@lists.llvm.org>, Aaron Ballman <aa...@aaronballman.com>
> *Subject: *Re: Add warning for c++ member variable shadowing
&g
gt;>,
"cfe-commits@lists.llvm.org<mailto:cfe-commits@lists.llvm.org>"
<cfe-commits@lists.llvm.org<mailto:cfe-commits@lists.llvm.org>>, Aaron Ballman
<aa...@aaronballman.com<mailto:aa...@aaronballman.com>>
Subject: Re: Add warning for c++ member vari
ames...@fb.com>
> *Cc: *Richard Smith <rich...@metafoo.co.uk>, "cfe-commits@lists.llvm.org"
> <cfe-commits@lists.llvm.org>, Aaron Ballman <aa...@aaronballman.com>
>
> *Subject: *Re: Add warning for c++ member variable shadowing
>
>
>
> I think that the pa
b.com>
Cc: Richard Smith <rich...@metafoo.co.uk>, "cfe-commits@lists.llvm.org"
<cfe-commits@lists.llvm.org>, Aaron Ballman <aa...@aaronballman.com>
Subject: Re: Add warning for c++ member variable shadowing
I think that the patch is starting to look p
o: *James Sun <james...@fb.com>
> *Cc: *Saleem Abdulrasool <compn...@compnerd.org>, "
> cfe-commits@lists.llvm.org" <cfe-commits@lists.llvm.org>, Aaron Ballman <
> aa...@aaronballman.com>
>
> *Subject: *Re: Add warning for c++ member variable
7 at 3:03 PM
To: James Sun <james...@fb.com>
Cc: Saleem Abdulrasool <compn...@compnerd.org>, "cfe-commits@lists.llvm.org"
<cfe-commits@lists.llvm.org>, Aaron Ballman <aa...@aaronballman.com>
Subject: Re: Add warning for c++ member variable shadowing
+def warn_shadow_me
;
>
>
>
> *From: *Saleem Abdulrasool <compn...@compnerd.org>
> *Date: *Tuesday, January 24, 2017 at 7:10 PM
> *To: *James Sun <james...@fb.com>
> *Cc: *"cfe-commits@lists.llvm.org" <cfe-commits@lists.llvm.org>, Aaron
> Ballman <aa...@aaronballman.co
llman.com>, Richard Smith <rich...@metafoo.co.uk>
Subject: Re: Add warning for c++ member variable shadowing
Some more stylistic comments:
The description that you have on CheckShadowInheritedVariables isn't really the
type of comments that we have in doxygen form. Im not sure if its in line
s...@fb.com>
> *Date: *Tuesday, January 24, 2017 at 2:36 PM
> *To: *"cfe-commits@lists.llvm.org" <cfe-commits@lists.llvm.org>
> *Subject: *Add warning for c++ member variable shadowing
>
>
>
> Dear members
>
>
>
> Here is a patch (attached) to
Coding style change
From: James Sun <james...@fb.com>
Date: Tuesday, January 24, 2017 at 2:36 PM
To: "cfe-commits@lists.llvm.org" <cfe-commits@lists.llvm.org>
Subject: Add warning for c++ member variable shadowing
Dear members
Here is a patch (attached) to create w
Dear members
Here is a patch (attached) to create warnings where a member variable shadows
the one in one of its inheriting classes. For cases where we really don't want
to shadow member variables, e.g.
class a {
int foo;
}
class b : a {
int foo; // Generate a warning
}
This patch
(1)
28 matches
Mail list logo