Mismatched deduction of auto types between different c++ compilers
Expanding from my comments:
g++ does not do this always, consider the example auto i = 0l, f = 0.0;
, it gives the error:
test.cpp: In function ‘int main()’:
test.cpp:4:5: error: inconsistent deduction for ‘auto’: ‘long int’ and then ‘double’
4 | auto i = 0l, f = 0.0;
If we compile your program and print the types of the variables (with this method), we get the following output:
v1: std::initializer_list<int>, i1: int const*
v2: std::initializer_list<int>, i2: int const*
using gcc version 9.2.0, with flags -std=c++17 -pedantic -Wall -Wextra
without any warning or error.
By your comment of the standard this program is ill-formed and the standard specifies that there should be emitted a diagnostic message (warning or error) unless otherwise specified (which it is not, in this case). Hence I would say that this is a bug in gcc.
It is a known bug.