diff options
Diffstat (limited to 'clang/unittests/StaticAnalyzer')
-rw-r--r-- | clang/unittests/StaticAnalyzer/RangeSetTest.cpp | 14 | ||||
-rw-r--r-- | clang/unittests/StaticAnalyzer/SValTest.cpp | 7 |
2 files changed, 10 insertions, 11 deletions
diff --git a/clang/unittests/StaticAnalyzer/RangeSetTest.cpp b/clang/unittests/StaticAnalyzer/RangeSetTest.cpp index 9e36aab..a8c7626 100644 --- a/clang/unittests/StaticAnalyzer/RangeSetTest.cpp +++ b/clang/unittests/StaticAnalyzer/RangeSetTest.cpp @@ -27,21 +27,21 @@ template <class RangeOrSet> static std::string toString(const RangeOrSet &Obj) { Obj.dump(SS); return ObjRepresentation; } -LLVM_ATTRIBUTE_UNUSED static std::string toString(const llvm::APSInt &Point) { +[[maybe_unused]] static std::string toString(const llvm::APSInt &Point) { return toString(Point, 10); } // We need it here for better fail diagnostics from gtest. -LLVM_ATTRIBUTE_UNUSED static std::ostream &operator<<(std::ostream &OS, - const RangeSet &Set) { +[[maybe_unused]] static std::ostream &operator<<(std::ostream &OS, + const RangeSet &Set) { return OS << toString(Set); } // We need it here for better fail diagnostics from gtest. -LLVM_ATTRIBUTE_UNUSED static std::ostream &operator<<(std::ostream &OS, - const Range &R) { +[[maybe_unused]] static std::ostream &operator<<(std::ostream &OS, + const Range &R) { return OS << toString(R); } -LLVM_ATTRIBUTE_UNUSED static std::ostream &operator<<(std::ostream &OS, - APSIntType Ty) { +[[maybe_unused]] static std::ostream &operator<<(std::ostream &OS, + APSIntType Ty) { return OS << (Ty.isUnsigned() ? "u" : "s") << Ty.getBitWidth(); } diff --git a/clang/unittests/StaticAnalyzer/SValTest.cpp b/clang/unittests/StaticAnalyzer/SValTest.cpp index db4b01b..f96456a 100644 --- a/clang/unittests/StaticAnalyzer/SValTest.cpp +++ b/clang/unittests/StaticAnalyzer/SValTest.cpp @@ -34,13 +34,12 @@ namespace clang { // getType() tests include whole bunch of type comparisons, // so when something is wrong, it's good to have gtest telling us // what are those types. -LLVM_ATTRIBUTE_UNUSED std::ostream &operator<<(std::ostream &OS, - const QualType &T) { +[[maybe_unused]] std::ostream &operator<<(std::ostream &OS, const QualType &T) { return OS << T.getAsString(); } -LLVM_ATTRIBUTE_UNUSED std::ostream &operator<<(std::ostream &OS, - const CanQualType &T) { +[[maybe_unused]] std::ostream &operator<<(std::ostream &OS, + const CanQualType &T) { return OS << QualType{T}; } |