This simple program is accepted by EDG (ICC) but rejected by GCC and Clang.
Is it well formed? If not, why?
int main() {
int n;
n.~int();
}
To the curious: The program doesn't do anything and I rather doubt there's even a use case for this language feature. There's templates, but whether they generate expression syntax is debatable. Such topics aren't appropriate for this site. Nothing to see here.
EDIT: The title of this question is odd. I thought the issue was the lack of an int::
qualifier before ~int
. The question was inspired by this Q&A, which encourages omission of the qualifier when invoking something like derived_object::~base_class()
. This however is ill-formed and only accepted by GCC.