Go to file
Marek Polacek 9f79c7ddff c++: wrong error due to std::initializer_list opt [PR116476]
Here maybe_init_list_as_array gets elttype=field, init={NON_LVALUE_EXPR <2>}
and it tries to convert the init's element type (int) to field
using implicit_conversion, which works, so overall maybe_init_list_as_array
is successful.

But it constifies init_elttype so we end up with "const int".  Later,
when we actually perform the conversion and invoke field::field(T&&),
we end up with this error:

  error: binding reference of type 'int&&' to 'const int' discards qualifiers

So I think maybe_init_list_as_array should try to perform the conversion,
like it does below with fc.

	PR c++/116476

gcc/cp/ChangeLog:

	* call.cc (maybe_init_list_as_array): Try convert_like and see if it
	worked.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/initlist-opt2.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
2024-08-28 18:45:54 -04:00
.github
c++tools
config
contrib
fixincludes
gcc c++: wrong error due to std::initializer_list opt [PR116476] 2024-08-28 18:45:54 -04:00
gnattools
gotools
include
INSTALL
libada
libatomic
libbacktrace
libcc1
libcody
libcpp Daily bump. 2024-08-28 00:19:45 +00:00
libdecnumber
libffi
libgcc Daily bump. 2024-08-28 00:19:45 +00:00
libgfortran
libgm2
libgo
libgomp libgomp: Add interop types and routines to OpenMP's headers and module 2024-08-28 11:50:43 +02:00
libgrust
libiberty
libitm
libobjc
libphobos
libquadmath Libquadmath: update doc for some constants 2024-08-28 15:53:05 +02:00
libsanitizer
libssp
libstdc++-v3 libstdc++: Fix autoconf check for O_NONBLOCK in <fcntl.h> 2024-08-28 21:34:22 +01:00
libvtv
lto-plugin Daily bump. 2024-08-24 00:18:13 +00:00
maintainer-scripts
zlib
.b4-config
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
SECURITY.txt
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.