Short answer: No, this is not allowed or better put it's not overriding but overwriting, i.e. you are not overriding Base::method() but creating a new method with the same name. Most compilers will warn you about that. With your example code, but assuming that Base::method is not pure virtual, consider this:
void callMethod(Base const& b)
{
auto a1 = b.method(); //what should the type of a1 be? -> it's int. Every time.
std::cout << a1 << '\n';
}
int main()
{
Der1 d1;
auto a2 = d1.method(); //a2 is ret1_1 of type ret1
callMethod(d1); //calls Base::method and prints that int, not Der1::method
}
You are right wrt that return types are not part of the function signature. But when overriding virtual functions, the signature is not all that matters. ยง10.3,7 explicitly states:
The return type of an overriding function shall be either identical to
the return type of the overridden function or covariant with the
classes of the functions. If a function D::f overrides a function
B::f, the return types of the functions are covariant if they satisfy
the following criteria:
โ both are pointers to classes, both are
lvalue references to classes, or both are rvalue references to
classes
โ the class in the return type of B::f is the same class as
the class in the return type of D::f, or is an unambiguous and
accessible direct or indirect base class of the class in the return
type of D::f
โ both pointers or references have the same
cv-qualification and the class type in the return type of D::f has the
same cv-qualification as or less cv-qualification than the class type
in the return type of B::f.