Author
anonymous
almost 8 years ago
Language
Compiler
Options
Author
anonymous
almost 8 years ago
$ prog.cc:32:16: error: no matching constructor for initialization of 'Tea'
return new Tea(this);
^ ~~~~
prog.cc:5:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'Builder *' to 'const Tea' for 1st argument
class Tea {};
^
prog.cc:5:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'Builder *' to 'Tea' for 1st argument
class Tea {};
^
prog.cc:5:7: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided
prog.cc:37:7: error: redefinition of 'Tea'
class Tea {
^
prog.cc:5:7: note: previous definition is here
class Tea {};
^
prog.cc:48:6: error: out-of-line definition of 'Tea' does not match any declaration in 'Tea'
Tea::Tea(Builder * b) {
^~~
prog.cc:49:5: error: use of undeclared identifier 'm_suger'
m_suger = b->m_suger;
^
prog.cc:50:5: error: use of undeclared identifier 'm_cup'
m_cup = b->m_cup;
^
prog.cc:51:5: error: use of undeclared identifier 'm_flavour'
m_flavour = b->m_flavour;
^
prog.cc:56:10: error: cannot initialize a variable of type 'Tea *' with an rvalue of type 'Builder *'
Tea* mintTea = new Builder()->cup(2)->sugar(3)->flavour("mint")->build();
^ ~~~~~~~~~~~~~
prog.cc:56:33: error: expected ';' at end of declaration
Tea* mintTea = new Builder()->cup(2)->sugar(3)->flavour("mint")->build();
^
;
prog.cc:55:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char *argv[]) {
^
prog.cc:55:26: warning: unused parameter 'argv' [-Wunused-parameter]
int main(int argc, char *argv[]) {
^
2 warnings and 8 errors generated.
Exit Code:
1