The next program ...
int main()
{
int{1}.~int();
}
not compiling (see match viewer ):
clang ++ trunk, with -std=c++1z
g ++ trunk, with -std=c++1z
CL 19 2017
A representation of a type alias for int...
int main()
{
using X = int;
int{1}.~X();
}
... makes the program valid for all the previously mentioned compilers without warnings (see match mapping ).
Why is a type alias needed when calling intdestructor? Is this because it is intnot a valid grammar element for invoking destruction?
source
share