]> granicus.if.org Git - llvm/commitdiff
[ARM] const cast fix for ARMAttributeParser test
authorSam Parker <sam.parker@arm.com>
Wed, 1 Feb 2017 12:58:57 +0000 (12:58 +0000)
committerSam Parker <sam.parker@arm.com>
Wed, 1 Feb 2017 12:58:57 +0000 (12:58 +0000)
GCC 4.8 produced a cast qualifier warning, so replaced with C++ style
const cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293764 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Support/ARMAttributeParser.cpp

index 82cbcd1fc153d26a4cb5a149766d38fc2e17463f..c2df6537ff63d936fb49327ebcc2155c24497f7c 100644 (file)
@@ -26,12 +26,13 @@ struct AttributeSection {
 };
 
 bool testBuildAttr(unsigned Tag, unsigned Value,
-                      unsigned ExpectedTag, unsigned ExpectedValue) {
+                   unsigned ExpectedTag, unsigned ExpectedValue) {
   std::string buffer;
   raw_string_ostream OS(buffer);
   AttributeSection Section(Tag, Value);
   Section.write(OS);
-  ArrayRef<uint8_t> Bytes((uint8_t*)OS.str().c_str(), OS.str().size());
+  ArrayRef<uint8_t> Bytes(
+    reinterpret_cast<const uint8_t*>(OS.str().c_str()), OS.str().size());
 
   ARMAttributeParser Parser;
   Parser.Parse(Bytes, true);