<p dir="ltr"><br>
On Jul 5, 2013 5:01 AM, "Vadium" <<a href="mailto:vabrva@gmail.com">vabrva@gmail.com</a>> wrote:<br>
><br>
> >On Thu, Jul 4, 2013 at 9:36 AM, David Blaikie &lt;dblaikie@&gt; wrote:<br>
> >> On Thu, Jul 4, 2013 at 8:38 AM, Vadium &lt;vabrva@&gt; wrote:<br>
> >>> Hi David,<br>
> >>><br>
> >>>I am trying to do the same anikau31 was trying to do, using your code:<br>
> >>><br>
> >>>> +  if (Optional<CFGStmt> CS = E.getAs<CFGStmt>()) {<br>
> >>>> +    const Stmt *S = CS->getStmt();<br>
> >>><br>
> >>> but I'm getting following error on second line:<br>
> >>><br>
> >>> " error: cannot convert 'clang::CFGStmt::getStmt' from type 'const<br>
> >>> clang::Stmt* (clang::CFGStmt::)()const' to type 'const clang::Stmt*' "<br>
> >><br>
> >><br>
> >> Looks like you wrote:<br>
> >><br>
> >> const Stmt *S = CS->getStmt;<br>
> >><br>
> >> And forgot the '()' where you should've written:<br>
> >><br>
> >> const Stmt *S = CS->getStmt();<br>
><br>
> Oh, thanks it was real reason.<br>
><br>
> >(& might I suggest self-hosting Clang as your compiler, in part<br>
> >because it has better error messages for this particular case (&<br>
> >others), if my guess is correct & the above is the problem. For<br>
> >example:<br>
> ><br>
> >call.cpp:7:24: error: reference to non-static member function must be<br>
> >called; did you mean to call it with no arguments?<br>
> >  const foo *f = bar().f;<br>
> >                 ~~~~~~^<br>
> >                        ()<br>
><br>
> You see I am building with ninja, which was noted to be preferable way<br>
> building plugins, checkers, tools for clang, and it has been noted there to<br>
> change cmake compiler to clang(++) what I actually did due to lack of<br>
> experience in catching my own bug, and previously clang showed me reasons<br>
> for all of them.</p>
<p dir="ltr">So you are using clang as your compiler? And you still got that less helpful error message? Perhaps you're using an old/out of date version.</p>
<p dir="ltr">><br>
> ><br>
> >><br>
> >>><br>
> >>> Thank you in advance,<br>
> >>><br>
> >>><br>
> >>><br>
> >>> --<br>
> >>> View this message in context:<br>
> >>> <a href="http://clang-developers.42468.n3.nabble.com/CFGElement-to-CFGStmt-tp4031123p4033020.html">http://clang-developers.42468.n3.nabble.com/CFGElement-to-CFGStmt-tp4031123p4033020.html</a><br>
> >>> Sent from the Clang Developers mailing list archive at Nabble.com.<br>
> >>> _______________________________________________<br>
> >>> cfe-dev mailing list<br>
> >>> cfe-dev@.uiuc<br>
> >>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
> >_______________________________________________<br>
> >cfe-dev mailing list<br>
> >cfe-dev@.uiuc<br>
> ><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
><br>
><br>
><br>
> -----<br>
> Since speech has been invented, people still can't understand each other.<br>
> --<br>
> View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/CFGElement-to-CFGStmt-tp4031123p4033033.html">http://clang-developers.42468.n3.nabble.com/CFGElement-to-CFGStmt-tp4031123p4033033.html</a><br>

> Sent from the Clang Developers mailing list archive at Nabble.com.<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</p>