Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 5 years ago

Language

C++

Compiler

gcc 10.1.0

Options
Warnings
Boost 1.73.0
C++2a(GNU)
no pedantic

Author

anonymous

almost 5 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-10.1.0/include -std=gnu++2a
prog.cc:6:1: error: stray '\' in program
    6 | \\do something
      | ^
prog.cc:6:2: error: stray '\' in program
    6 | \\do something
      |  ^
prog.cc: In function 'int main()':
prog.cc:4:1: error: 'string' was not declared in this scope
    4 | string yes = "YES";
      | ^~~~~~
prog.cc:4:1: note: suggested alternatives:
In file included from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/iosfwd:39,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ios:38,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ostream:38,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/iostream:39,
                 from prog.cc:1:
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/stringfwd.h:79:33: note:   'std::string'
   79 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/locale_classes.h:40,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/ios_base.h:41,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ios:42,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ostream:38,
                 from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/iostream:39,
                 from prog.cc:1:
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/string:67:11: note:   'std::pmr::string'
   67 |     using string    = basic_string<char>;
      |           ^~~~~~
prog.cc:5:7: error: expected ';' before 'no'
    5 | string no = "NO";
      |       ^~~
      |       ;
prog.cc:6:6: error: 'something' was not declared in this scope
    6 | \\do something
      |      ^~~~~~~~~
prog.cc:9:13: error: expected 'while' before '{' token
    9 |         else{
      |             ^
prog.cc:9:13: error: expected '(' before '{' token
    9 |         else{
      |             ^
      |             (
prog.cc:9:13: error: expected primary-expression before '{' token
prog.cc:9:13: error: expected ')' before '{' token
    9 |         else{
      |             ^
      |             )
prog.cc:9:13: error: expected ';' before '{' token
    9 |         else{
      |             ^
      |             ;
prog.cc:10:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |            cout << no;}
      |            ^~~~
      |            std::cout
In file included from prog.cc:1:
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~
prog.cc:10:20: error: 'no' was not declared in this scope
   10 |            cout << no;}
      |                    ^~
Exit Code:
1