[clang] 984cfdc - [clang][cli] Fix gcc warning (NFC)
Yang Fan via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 10 20:38:36 PST 2021
Author: Yang Fan
Date: 2021-02-11T12:38:09+08:00
New Revision: 984cfdc6ee8b4550238dccf212d786c4ded49cf7
URL: https://github.com/llvm/llvm-project/commit/984cfdc6ee8b4550238dccf212d786c4ded49cf7
DIFF: https://github.com/llvm/llvm-project/commit/984cfdc6ee8b4550238dccf212d786c4ded49cf7.diff
LOG: [clang][cli] Fix gcc warning (NFC)
GCC warning:
```
/llvm-project/clang/lib/Frontend/TestModuleFileExtension.cpp:131:20: warning: ‘llvm::raw_ostream& clang::operator<<(llvm::raw_ostream&, const clang::TestModuleFileExtension&)’ has not been declared within ‘clang’
131 | llvm::raw_ostream &clang::operator<<(llvm::raw_ostream &OS,
| ^~~~~
In file included from /llvm-project/clang/lib/Frontend/TestModuleFileExtension.cpp:8:
/llvm-project/clang/lib/Frontend/TestModuleFileExtension.h:75:3: note: only here as a ‘friend’
75 | operator<<(llvm::raw_ostream &OS, const TestModuleFileExtension &Extension);
| ^~~~~~~~
```
Added:
Modified:
clang/lib/Frontend/TestModuleFileExtension.cpp
Removed:
################################################################################
diff --git a/clang/lib/Frontend/TestModuleFileExtension.cpp b/clang/lib/Frontend/TestModuleFileExtension.cpp
index f7d3f15046fe..04609691950d 100644
--- a/clang/lib/Frontend/TestModuleFileExtension.cpp
+++ b/clang/lib/Frontend/TestModuleFileExtension.cpp
@@ -128,9 +128,11 @@ TestModuleFileExtension::createExtensionReader(
new TestModuleFileExtension::Reader(this, Stream));
}
-llvm::raw_ostream &clang::operator<<(llvm::raw_ostream &OS,
- const TestModuleFileExtension &Extension) {
+namespace clang {
+llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
+ const TestModuleFileExtension &Extension) {
return OS << Extension.BlockName << ":" << Extension.MajorVersion << ":"
<< Extension.MinorVersion << ":" << Extension.Hashed << ":"
<< Extension.UserInfo;
}
+} // namespace clang
More information about the cfe-commits
mailing list