https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92509
Bug ID: 92509 Summary: auto deduction on different types does not emit diagnostic message Product: gcc Version: 9.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: g...@nicholas-schwab.de Target Milestone: --- Created attachment 47264 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47264&action=edit Preprocessed file on which the error occurs. By the standard, "if the type that replaces the placeholder type is not the same in each deduction, the program is ill-formed." Hence the declaration auto i = 0l, j = 0.0; should emit a diagnostic message, as it does with an error message. In a more complex case (prepocessed file attached) this compiles without warning or error. Was discussed on https://stackoverflow.com/questions/58855626/mismatched-deduction-of-auto-types-between-different-c-compilers/58856708#58856708 Compiler call: g++ -v -Wextra -Wall dot.cpp (preprocessed file created with g++ -save-temps -Wextra -Wall dot.cpp) Compiler Output: None GCC information: Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-shared --enable-threads=posix --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto gdc_include_dir=/usr/include/dlang/gdc Thread model: posix gcc version 9.2.0 (GCC)