summaryrefslogtreecommitdiffstats
path: root/tools/clang-tidy/test/performance-avoid-endl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/clang-tidy/test/performance-avoid-endl.cpp')
-rw-r--r--tools/clang-tidy/test/performance-avoid-endl.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/clang-tidy/test/performance-avoid-endl.cpp b/tools/clang-tidy/test/performance-avoid-endl.cpp
new file mode 100644
index 0000000000..1d7b395b57
--- /dev/null
+++ b/tools/clang-tidy/test/performance-avoid-endl.cpp
@@ -0,0 +1,34 @@
+namespace std {
+ template <typename CharT>
+ class basic_ostream {
+ public:
+ template <typename T>
+ basic_ostream& operator<<(T);
+ basic_ostream& operator<<(basic_ostream<CharT>& (*)(basic_ostream<CharT>&));
+ };
+
+ template <typename CharT>
+ class basic_iostream : public basic_ostream<CharT> {};
+
+ using ostream = basic_ostream<char>;
+ using wostream = basic_ostream<wchar_t>;
+
+ using iostream = basic_iostream<char>;
+ using wiostream = basic_iostream<wchar_t>;
+
+ ostream cout;
+ wostream wcout;
+
+ ostream cerr;
+ wostream wcerr;
+
+ ostream clog;
+ wostream wclog;
+
+ template<typename CharT>
+ basic_ostream<CharT>& endl(basic_ostream<CharT>&);
+} // namespace std
+
+int main() {
+ std::cout << "Hello" << std::endl;
+}