This simple code produces some unexpected results. At least for me...
#include <iostream>
class cls1
{
public:
cls1(){std::cout << "cls1()" << std::endl;};
cls1(int, int) : cls1() {std::cout << "cls1(int, int)" << std::endl;}
};
class cls2 : public cls1
{
public:
using cls1::cls1;
cls2() = delete;
};
int main()
{
cls2 c();
return 0;
}
I would expect an output to be: cls1() as the default constructor is deleted for cls2, but the code does not output anything, though it compiles and runs fine. I am using GCC ver. 4.8.2. Compile with:
$ g++ -std=c++11 -g test.cpp
$ ./a.out
The question is: how should it behave?
Thank you!