r224844 - Sema: Qualify getPrintable's Expr argument

David Blaikie dblaikie at gmail.com
Fri Dec 26 10:01:58 PST 2014


Ooh, ouch. Any idea if this is worth a warning? (not sure if there's any
particular axis to generalize it on to catch a broader class of problems)

On Thu, Dec 25, 2014 at 10:06 PM, David Majnemer <david.majnemer at gmail.com>
wrote:

> Author: majnemer
> Date: Fri Dec 26 00:06:56 2014
> New Revision: 224844
>
> URL: http://llvm.org/viewvc/llvm-project?rev=224844&view=rev
> Log:
> Sema: Qualify getPrintable's Expr argument
>
> getPrintable has an overload which takes a bool.  This means that const
> qualified Exprs would get forwarded to the bool overload instead of the
> Expr overload.
>
> Modified:
>     cfe/trunk/include/clang/Sema/Sema.h
>
> Modified: cfe/trunk/include/clang/Sema/Sema.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=224844&r1=224843&r2=224844&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/Sema/Sema.h (original)
> +++ cfe/trunk/include/clang/Sema/Sema.h Fri Dec 26 00:06:56 2014
> @@ -1251,7 +1251,7 @@ public:
>    static QualType getPrintable(QualType T) { return T; }
>    static SourceRange getPrintable(SourceRange R) { return R; }
>    static SourceRange getPrintable(SourceLocation L) { return L; }
> -  static SourceRange getPrintable(Expr *E) { return E->getSourceRange(); }
> +  static SourceRange getPrintable(const Expr *E) { return
> E->getSourceRange(); }
>    static SourceRange getPrintable(TypeLoc TL) { return
> TL.getSourceRange();}
>
>    template<typename T1>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141226/936b4e63/attachment.html>


More information about the cfe-commits mailing list