Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1950)

Issue 4439065: Add a method which checks if an expression could be turned into a function call

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years ago by matthewbg
Modified:
13 years ago
Reviewers:
chandlerc
Visibility:
Public.

Description

I want Clang to issue a fixit every time I write 'method_name' where I meant 'method_name()'. As a first step, provide a general-purpose method to check whether an expression looks like something that could be turned into a function call, e.g. a DeclRefExpr which refers to a function, or an expression of function pointer type.

Patch Set 1 #

Total comments: 10

Patch Set 2 : Review tweaks, re-add overload notes #

Patch Set 3 : Merge in rjmccall's r130239 and factor out a PrintOverloads method #

Total comments: 16

Patch Set 4 : Further changes per review #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -111 lines) Patch
M include/clang/Sema/Sema.h View 1 2 3 1 chunk +8 lines, -1 line 0 comments Download
M lib/Sema/Sema.cpp View 1 2 3 2 chunks +98 lines, -0 lines 2 comments Download
M lib/Sema/SemaExpr.cpp View 1 2 3 1 chunk +39 lines, -107 lines 0 comments Download
M test/SemaCXX/member-expr.cpp View 1 2 chunks +9 lines, -3 lines 0 comments Download

Messages

Total messages: 10
matthewbg
13 years ago (2011-04-22 21:50:12 UTC) #1
matthewbg
13 years ago (2011-04-22 22:11:24 UTC) #2
matthewbg
Still getting the hang of this whole Rietveld thing... anyway, patch does what it says ...
13 years ago (2011-04-22 22:13:22 UTC) #3
chandlerc
Just a few stylistic comments. Generally looks fine to me. I'll be glad to see ...
13 years ago (2011-04-22 22:24:44 UTC) #4
matthewbg
PTAL http://codereview.appspot.com/4439065/diff/1/include/clang/Sema/Sema.h File include/clang/Sema/Sema.h (right): http://codereview.appspot.com/4439065/diff/1/include/clang/Sema/Sema.h#newcode1940 include/clang/Sema/Sema.h:1940: bool CanCall(const Expr* E, QualType& ZeroArgCallReturnTy, On 2011/04/22 ...
13 years ago (2011-04-25 17:55:55 UTC) #5
matthewbg
PTAL for reals. I factored out the overload note printing, so the boilerplate in SemaExpr.cpp ...
13 years ago (2011-04-28 04:01:21 UTC) #6
chandlerc
Some more comments now... http://codereview.appspot.com/4439065/diff/9001/include/clang/Sema/Sema.h File include/clang/Sema/Sema.h (right): http://codereview.appspot.com/4439065/diff/9001/include/clang/Sema/Sema.h#newcode2072 include/clang/Sema/Sema.h:2072: bool IsExprCallable(const Expr& E, QualType& ...
13 years ago (2011-04-28 04:20:31 UTC) #7
matthewbg
http://codereview.appspot.com/4439065/diff/9001/include/clang/Sema/Sema.h File include/clang/Sema/Sema.h (right): http://codereview.appspot.com/4439065/diff/9001/include/clang/Sema/Sema.h#newcode2072 include/clang/Sema/Sema.h:2072: bool IsExprCallable(const Expr& E, QualType& ZeroArgCallReturnTy, On 2011/04/28 04:20:31, ...
13 years ago (2011-04-28 18:56:48 UTC) #8
chandlerc
Submit away whenever.... none of this is important http://codereview.appspot.com/4439065/diff/13001/lib/Sema/Sema.cpp File lib/Sema/Sema.cpp (right): http://codereview.appspot.com/4439065/diff/13001/lib/Sema/Sema.cpp#newcode809 lib/Sema/Sema.cpp:809: if ...
13 years ago (2011-05-04 20:21:46 UTC) #9
matthewbg
13 years ago (2011-05-04 22:16:15 UTC) #10
All done, and committed in r130878. Thanks!

On Wed, May 4, 2011 at 13:21,  <chandlerc@gmail.com> wrote:
> Submit away whenever.... none of this is important
>
>
> http://codereview.appspot.com/4439065/diff/13001/lib/Sema/Sema.cpp
> File lib/Sema/Sema.cpp (right):
>
> http://codereview.appspot.com/4439065/diff/13001/lib/Sema/Sema.cpp#newcode809
> lib/Sema/Sema.cpp:809: if (const PointerType *Ptr =
> ExprTy->getAs<PointerType>())
> What about references?
>
> http://codereview.appspot.com/4439065/diff/13001/lib/Sema/Sema.cpp#newcode833
> lib/Sema/Sema.cpp:833: /// A companion to IsExprCallable. In cases when
> the name that the programmer
> s/Is/is/
>
> http://codereview.appspot.com/4439065/
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b