|
|
ostreamoverloading.cpp:27:1: error: ‘friend’ used outside of class friend std::istream &operator>> (std::istream& is, Obj& o) ^ ostreamoverloading.cpp: In function ‘std::istream& operator>>(std::istream&, Obj&)’: ostreamoverloading.cpp:9:17: error: ‘std::string Obj::output’ is private std::string output; ^ ostreamoverloading.cpp:30:24: error: within this context std::getline(is, o.output; ^ ostreamoverloading.cpp:30:30: error: expected ‘)’ before ‘;’ token std::getline(is, o.output; |
if(line.find("error:") != std::string::npos)
ostreamoverloading.cpp:27:1: error: ‘friend’ used outside of class friend std::istream &operator>> (std::istream& is, Obj& o) ^ ostreamoverloading.cpp: In function ‘std::istream& operator>>(std::istream&, Obj&)’: ostreamoverloading.cpp:9:17: error: ‘std::string Obj::output’ is private std::string output; ^ ostreamoverloading.cpp:30:24: error: within this context std::getline(is, o.output; ^ ostreamoverloading.cpp:30:30: error: expected ‘)’ before ‘;’ token std::getline(is, o.output; --------------------------------------------------------------------- ostreamoverloading.cpp 27 error: ‘friend’ used outside of class In function ‘std::istream& operator>>(std::istream&, Obj&)’ --------------------------------------------------------------------- ostreamoverloading.cpp error: ‘std::string Obj::output’ is private 30 within this context std::getline(is, o.output; --------------------------------------------------------------------- ostreamoverloading.cpp 30 error: expected ‘)’ before ‘;’ token --------------------------------------------------------------------- |
ostreamoverloading.cpp --------------------------------------------- error: ‘friend’ used outside of class In function ‘std::istream& operator>>(std::istream&, Obj&)’on line 27 error: ‘std::string Obj::output’ is private within this context std::getline(is, o.output; on line 30 error: expected ‘)’ before ‘;’ token on line 30 NextFileErrors.h----------------------------------------------------- error: ... |
|
|
|
|
ln -s /Archive2/4e/15a6cbcbf5852d/main.cpp test.cpp g++ -std=c++14 -O2 -Wall -Wextra -pedantic-errors -ofilt main.cpp echo . && echo . && g++ -std=c++14 -O2 -Wall -Wextra -pedantic-errors -c -fdiagnostics-show-location=once -fno-diagnostics-show-caret -fno-diagnostics-show-option test.cpp 2>&1 | ./filt . . test.cpp line 10 col 1: error: 'friend' used outside of class In function 'void foo(A&)': test.cpp line 6 col 18: error: 'int A::v' is private test.cpp line 12 col 7: error: within this context In function 'int main()': test.cpp line 18 col 7: error: increment of read-only variable 'i' test.cpp line 20 col 13: error: expected ')' before ';' token test.cpp line 20 col 13: warning: statement has no effect |
-fmessage-length=n Try to format error messages so that they fit on lines of about n characters. The default is 72 characters for g++ and 0 for the rest of the front ends supported by GCC. If n is zero, then no line-wrapping is done; each error message appears on a single line. -fno-diagnostics-show-caret By default, each diagnostic emitted includes the original source line and a caret '^' indicating the column. This option suppresses this information. https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/Language-Independent-Options.html#Language-Independent-Options |