foo.cc: In member function 'int Date::DayInMonth()':
foo.cc:23:7: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
23 | else return 28; break;
| ^~~~
foo.cc:23:23: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
23 | else return 28; break;
| ^~~~~
foo.cc: In function 'int main()':
foo.cc:60:20: error: 'Date::Date(int, int, int)' is private within this context
60 | Date date1(y, m, d);
| ^
foo.cc:14:2: note: declared private here
14 | Date(int y, int m, int d) {
| ^~~~
foo.cc:62:20: error: 'Date::Date(int, int, int)' is private within this context
62 | Date date2(y, m, d);
| ^
foo.cc:14:2: note: declared private here
14 | Date(int y, int m, int d) {
| ^~~~
foo.cc:66:14: error: 'void Date::add(int)' is private within this context
66 | date1.add(1);
| ^
foo.cc:38:7: note: declared private here
38 | void add(int n) {
| ^~~
foo.cc:67:16: error: 'bool Date::operator==(Date&)' is private within this context
67 | if (date1 == date2) {
| ^~~~~
foo.cc:53:7: note: declared private here
53 | bool operator==(Date& a) {
| ^~~~~~~~
foo.cc: In member function 'int Date::DayInMonth()':
foo.cc:37:2: warning: control reaches end of non-void function [-Wreturn-type]
37 | }
| ^
[Hydro](https://hydro.ac)提供评测服务