Go to file
Jason Merrill 124a9e08b7 c++: -Waddress and if constexpr [PR94554]
Like we avoid various warnings for seemingly tautological expressions when
substituting a template, we should avoid warning for the implicit conversion
to bool in an if statement.  I considered also doing this for the conditions
in loop expressions, but that seems unnecessary, as a loop condition is
unlikely to be a constant.

The change to finish_if_stmt_cond isn't necessary since dependent_operand_p
looks through IMPLICIT_CONV_EXPR, but makes it more constent with
e.g. build_x_binary_op that determines the type of an expression and then
builds it using the original operands.

	PR c++/94554

gcc/cp/ChangeLog:

	* pt.cc (dependent_operand_p): Split out from...
	(tsubst_copy_and_build): ...here.
	(tsubst_expr) [IF_STMT]: Use it.
	* semantics.cc (finish_if_stmt_cond): Keep the pre-conversion
	condition in the template tree.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp1z/constexpr-if38.C: New test.
2022-06-23 11:07:21 -04:00
c++tools
config Daily bump. 2022-06-02 00:16:32 +00:00
contrib Daily bump. 2022-05-28 00:16:40 +00:00
fixincludes
gcc c++: -Waddress and if constexpr [PR94554] 2022-06-23 11:07:21 -04:00
gnattools
gotools
include Daily bump. 2022-06-14 00:16:39 +00:00
INSTALL
intl
libada
libatomic Daily bump. 2022-06-03 00:16:40 +00:00
libbacktrace Daily bump. 2022-05-29 00:16:31 +00:00
libcc1 Daily bump. 2022-06-02 00:16:32 +00:00
libcody Daily bump. 2022-06-04 00:16:27 +00:00
libcpp Daily bump. 2022-05-30 00:16:21 +00:00
libdecnumber Daily bump. 2022-05-21 00:16:32 +00:00
libffi
libgcc Daily bump. 2022-06-10 00:16:43 +00:00
libgfortran
libgo libgo: #include <sys/types.h> when checking for loff_t 2022-06-21 08:03:17 -07:00
libgomp Daily bump. 2022-06-22 00:16:25 +00:00
libiberty Daily bump. 2022-05-24 00:17:03 +00:00
libitm Daily bump. 2022-06-03 00:16:40 +00:00
libobjc
liboffloadmic
libphobos Daily bump. 2022-06-23 00:16:40 +00:00
libquadmath
libsanitizer
libssp
libstdc++-v3 libstdc++: Simplify test by not using std::log2 2022-06-23 12:00:01 +01:00
libvtv
lto-plugin Daily bump. 2022-06-21 00:16:27 +00:00
maintainer-scripts Daily bump. 2022-05-21 00:16:32 +00:00
zlib
.dir-locals.el
.gitattributes
.gitignore Vim swap files not ignored 2022-05-28 09:38:29 -06:00
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2022-05-29 00:16:31 +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
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.