The new "Simplify Instance Declaration" feature doesn't account for the C++ "most vexing parse" rule. This example is contrived, but shows the problem:
struct S
{
S(int i) : m_i(i) {}
operator int() const { return m_i; }
int m_i;
};
int f(int x)
{
auto i = int(S(x));
return i;
}
If "Simplify Instance Declaration" is used on the declaration of "i", then VAX generates the following incorrect code:
int i(S(x));
By C++'s "most vexing parse" rule, this is parsed as a function declaration, not a variable initialization. VAX should generate one of these two lines instead:
int i{S(x)};
int i((S(x)));
The former requires a compiler new enough to understand the brace initialization syntax (VS 2012? 2013?).
Melissa