diff options
author | Jay Foad <jay.foad@gmail.com> | 2010-12-07 08:25:34 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2010-12-07 08:25:34 +0000 |
commit | 9f71a8f4c7a182a5236da9e747d57cc1d1bd24c2 (patch) | |
tree | de2e74ed442ebccd54b82089e7953960c93a27ec /lib/Sema/SemaTemplate.cpp | |
parent | dd182ff10b9145e432dea1fd2fb67100ccca3b10 (diff) |
PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121121 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 1a8c44a0e6..29f77f333d 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -3120,7 +3120,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, // based on the template parameter's type. unsigned AllowedBits = Context.getTypeSize(IntegerType); if (Value.getBitWidth() != AllowedBits) - Value.extOrTrunc(AllowedBits); + Value = Value.extOrTrunc(AllowedBits); Value.setIsSigned(IntegerType->isSignedIntegerType()); // Complain if an unsigned parameter received a negative value. |