A C++ object can be explicitly destructed using destructor call syntax (for non-class types pseudo-destructed). But it looks like that in addition to universally accepted syntax, almost any modern compiler supports its own ways of calling the destructor:
using T = int;
const int x = 1;
int main() {
x.~T(); //ok everywhere
x.~int(); //#1: ok in MSVC only
x.~auto(); //#2: ok in GCC only
x.~decltype(x)(); //#3: ok in Clang and MSVC only
}
In addition to x.~T(), which works in all compilers, there are at least 3 other options, demo: https://gcc.godbolt.org/z/895bd9T5c
Are any of the options #1, #2 or #3 legal according to the standard or all of them are just extensions/bugs of the corresponding compilers?