Today I accidentally added the extension '.c' on a CPP program (with namespaces, classes and whatnot inside) and passed it to g++. It compiled it without an issue, but shouldn't it have treated it as a C Program and throw an error or a warning? On other threads I read that the extension for g++ doesn't matter (some suggest using any arbitrary extension that's not taken, however I tried other extension asides from the standard .c,.C,.cpp etc) and they are not recognised.
So, what exactly happens here with the extensions? Was my cpp program compiled as a cpp program or as a c one?