On 09/04/2019 11.56, Brian Bi wrote:
> On Tue, Apr 9, 2019 at 10:51 AM Matthew Woehlke wrote:
>> struct bar
>> {
>> bar(size_t a, size_t b) {}
>> };
>>
>> int main()
>> {
>> constexpr int y = 5;
>>
>> size_t works[] = { 1, y };
>> bar error{ 1, y };
>>
>> return 0;
>> }
>
> In this corrected example, which of the two list-initializations are you
> concerned about?
The second ("error") produces an error on VS, while the first ("works")
does not. (GCC/clang accept both.)
Realizing now that the problem is with *constructors*, I can see why
there *might* be a difference (overload resolution in particular adds a
wrinkle), hence the updated example. However, based on my own reading,
Andrew's replies, and the similar errors from both if I take away the
`constexpr`, I still believe this to be a VS bug... and apparently MS
agrees, as it is allegedly fixed in VS2019 (I don't have it to test).
--
Matthew