Author
anonymous
almost 7 years ago
Language
C++
Compiler
gcc 8.2.0
Options
Warnings
Boost 1.69.0
C++2a(GNU)
-pedantic-errors
Author
anonymous
almost 7 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.69.0/gcc-8.2.0/include -std=gnu++2a -pedantic-errors prog.cc:24:14: error: 'std::string' has not been declared
Z(int p, std::string name);
^~~
prog.cc:28:14: error: 'shared_ptr' in namespace 'std' does not name a template type
typedef std::shared_ptr<SI::Z> ZPtr;
^~~~~~~~~~
prog.cc:28:9: note: 'std::shared_ptr' is defined in header '<memory>'; did you forget to '#include <memory>'?
prog.cc:1:1:
+#include <memory>
namespace NS {
prog.cc:28:9:
typedef std::shared_ptr<SI::Z> ZPtr;
^~~
prog.cc:31:17: error: 'std::string' has not been declared
SI::Z::Z(int p, std::string name) : obj3(p)
^~~
prog.cc: In constructor 'SI::Z::Z(int, int)':
prog.cc:31:29: warning: unused parameter 'name' [-Wunused-parameter]
SI::Z::Z(int p, std::string name) : obj3(p)
~~~~~~~~~~~~^~~~
prog.cc: At global scope:
prog.cc:40:9: error: 'ZPtr' in namespace 'SI' does not name a type
SI::ZPtr obj2;
^~~~
prog.cc: In constructor 'SI::Y::Y(int)':
prog.cc:44:19: error: class 'SI::Y' does not have any field named 'obj2'
SI::Y::Y(int p) : obj2(std::make_shared<SI::Z>(SI::Z(p,"hi")))
^~~~
prog.cc:44:29: error: 'make_shared' is not a member of 'std'
SI::Y::Y(int p) : obj2(std::make_shared<SI::Z>(SI::Z(p,"hi")))
^~~~~~~~~~~
prog.cc:44:29: note: 'std::make_shared' is defined in header '<memory>'; did you forget to '#include <memory>'?
prog.cc:44:46: error: expected primary-expression before '>' token
SI::Y::Y(int p) : obj2(std::make_shared<SI::Z>(SI::Z(p,"hi")))
^
prog.cc:44:60: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
SI::Y::Y(int p) : obj2(std::make_shared<SI::Z>(SI::Z(p,"hi")))
^
prog.cc:31:29: note: initializing argument 2 of 'SI::Z::Z(int, int)'
SI::Z::Z(int p, std::string name) : obj3(p)
~~~~~~~~~~~~^~~~
prog.cc: At global scope:
prog.cc:54:9: error: 'unique_ptr' in namespace 'std' does not name a template type
std::unique_ptr<Y> obj1;
^~~~~~~~~~
prog.cc:54:4: note: 'std::unique_ptr' is defined in header '<memory>'; did you forget to '#include <memory>'?
std::unique_ptr<Y> obj1;
^~~
Exit Code:
1