Go to file
Marek Polacek 9d2b80ea51 PR c++/91962 - ICE with reference binding and qualification conversion.
When fixing c++/91889 (r276251) I was assuming that we couldn't have a ck_qual
under a ck_ref_bind, and I was introducing it in the patch and so this
+   if (next_conversion (convs)->kind == ck_qual)
+     {
+       gcc_assert (same_type_p (TREE_TYPE (expr),
+                    next_conversion (convs)->type));
+       /* Strip the cast created by the ck_qual; cp_build_addr_expr
+          below expects an lvalue.  */
+       STRIP_NOPS (expr);
+     }
in convert_like_real was supposed to handle it.  But that assumption was wrong
as this test shows; here we have "(int *)f" where f is of type long int, and
we're converting it to "const int *const &", so we have both ck_ref_bind and
ck_qual.  That means that the new STRIP_NOPS strips an expression it shouldn't
have, and that then breaks when creating a TARGET_EXPR.  So we want to limit
the stripping to the new case only.  This I do by checking need_temporary_p,
which will be 0 in the new case.  Yes, we can set need_temporary_p when
binding a reference directly, but then we won't have a qualification
conversion.  It is possible to have a bit-field, convert it to a pointer,
and then convert that pointer to a more-qualified pointer, but in that case
we're not dealing with an lvalue, so gl_kind is 0, so we won't enter this
block in reference_binding:
 1747   if ((related_p || compatible_p) && gl_kind)

	* call.c (convert_like_real) <case ck_ref_bind>: Check need_temporary_p.

	* g++.dg/cpp0x/ref-bind7.C: New test.

From-SVN: r278416
2019-11-18 16:39:24 +00:00
config
contrib download_prerequisites: Use http instead of ftp for downloading. 2019-11-13 19:48:52 +02:00
fixincludes
gcc PR c++/91962 - ICE with reference binding and qualification conversion. 2019-11-18 16:39:24 +00:00
gnattools
gotools
include [PATCH] Fix slowness in demangler 2019-11-16 10:14:14 -07:00
INSTALL
intl
libada
libatomic
libbacktrace
libcc1
libcpp Support UTF-8 character constants for C2x. 2019-11-14 20:18:33 +00:00
libdecnumber
libffi
libgcc fix ChangeLog to reference the PR 2019-11-18 12:46:56 +00:00
libgfortran libgfortran: Regenerate Makefile.in' for runstatedir' removal 2019-11-18 00:21:45 +00:00
libgo testmain.exp: link against GOLIBS 2019-11-15 21:14:29 +00:00
libgomp libgomp: Regenerate `testsuite/Makefile.in' for GCC_HEADER_STDINT removal 2019-11-18 00:33:37 +00:00
libhsail-rt
libiberty [PATCH] Fix slowness in demangler 2019-11-16 10:14:14 -07:00
libitm
libobjc
liboffloadmic
libphobos
libquadmath
libsanitizer Enable libsanitizer build on riscv64 2019-11-13 09:45:15 +00:00
libssp
libstdc++-v3 libstdc++: Fix std::jthread bugs 2019-11-18 12:46:08 +00:00
libvtv
lto-plugin
maintainer-scripts update_version_svn (IGNORE_BRANCHES): Add 7. 2019-11-14 07:41:56 +00:00
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog MAINTAINERS: Change my email address as maintainer. 2019-11-15 17:52:25 +00:00
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 MAINTAINERS: Change my email address as maintainer. 2019-11-15 17:52:25 +00:00
Makefile.def
Makefile.in
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
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.