Skip to content

Commit e30b1f5

Browse files
committed
[AST/Unittest] Don't swallow a const qualifier.
I found this by inspection (also, I found that newer clang versions also warns for this under -Wall). While here, convert to static_cast<> for a more idiomatic C++.
1 parent 5ccebbf commit e30b1f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

unittests/AST/SourceLocTests.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ namespace swift {
2323
void PrintTo(SourceLoc loc, std::ostream *os) {
2424
*os << loc.getOpaquePointerValue();
2525
if (loc.isValid())
26-
*os << " '" << *(char *)loc.getOpaquePointerValue() << "'";
26+
*os << " '" << *static_cast<const char *>(loc.getOpaquePointerValue())
27+
<< "'";
2728
}
2829

2930
void PrintTo(SourceRange range, std::ostream *os) {

0 commit comments

Comments
 (0)