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.majne...@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@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits