Index: clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp +++ clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp @@ -66,6 +66,10 @@ ->getName())) return false; break; + case TypeLoc::Typedef: + if (VisitUnqualName( + TL.getAs().getTypePtr()->getDecl()->getName())) + return false; default: break; } Index: clang-tools-extra/test/clang-tidy/checkers/modernize-use-trailing-return-type.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize-use-trailing-return-type.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize-use-trailing-return-type.cpp @@ -9,10 +9,16 @@ class string; - class ostream; + template + class basic_ostream; + + using ostream = basic_ostream; template auto declval() -> T; + + template + class tuple; } // @@ -527,6 +533,10 @@ std::array j8(unsigned Size); // CHECK-MESSAGES: :[[@LINE-1]]:44: warning: use a trailing return type for this function [modernize-use-trailing-return-type] // CHECK-FIXES: {{^}}std::array j8(unsigned Size);{{$}} +using std::ostream; +std::tuple& operator<<(ostream& ostream, float i); +// CHECK-MESSAGES: :[[@LINE-1]]:40: warning: use a trailing return type for this function [modernize-use-trailing-return-type] +// CHECK-FIXES: {{^}}std::tuple& operator<<(ostream& ostream, float i);{{$}} class CC { int Object; @@ -552,7 +562,6 @@ // bug 44206, no rewrite should happen due to collision with parameter name // -using std::ostream; ostream& operator<<(ostream& ostream, int i); // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: use a trailing return type for this function [modernize-use-trailing-return-type] // CHECK-FIXES: {{^}}ostream& operator<<(ostream& ostream, int i);{{$}}