1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 01:06:01 +02:00
cdt/core
Marc-Andre Laperle 0748cd24c6 Bug 573764 - Ambiguous conversion on numeric type
Starting with C++11, a null pointer constant has to be specifically an
integer literal of 0 and not any constant expression. Before this
change, an expression like (0 & 1) would wrongly being considered a null
pointer constant. It also means it could implicitly convert to a pointer
type (like int *) and lead to problems during function resolution, like
ambiguity.

This change corrects the behavior for C++11 by tracking whether the
integer type (basic type) came from a literal expression so that we can
add this additional constraint when checking for a null pointer
constant. Because types are sometimes returned directly when evaluating
different kinds of non-literal expressions that contain literal
expressions, we have to be careful that we remove the flag that tracks
"from literal expression".

Unfortunately, the semantic code does not track the active C++ version
which means the behavior for pre-C++11 will be impacted. Tracking the
active C++ version would not be trivial and at least the new behavior is
more future-proof.

Change-Id: Ied625e96e70390872e36ab5bb4dc238d75809d2e
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2021-06-26 14:09:08 -04:00
..
org.eclipse.cdt.core Bug 573764 - Ambiguous conversion on numeric type 2021-06-26 14:09:08 -04:00
org.eclipse.cdt.core.linux [releng] Bump to CDT version 10.4.0 2021-06-12 20:52:54 -04:00
org.eclipse.cdt.core.linux.aarch64 [releng] Bump to CDT version 10.4.0 2021-06-12 20:52:54 -04:00
org.eclipse.cdt.core.linux.ppc64le [releng] Bump to CDT version 10.4.0 2021-06-12 20:52:54 -04:00
org.eclipse.cdt.core.linux.x86_64 [releng] Bump to CDT version 10.4.0 2021-06-12 20:52:54 -04:00
org.eclipse.cdt.core.macosx [releng] Bump to CDT version 10.4.0 2021-06-12 20:52:54 -04:00
org.eclipse.cdt.core.native Bug 573677: Mark methods that don't handle commands well as deprecated 2021-06-14 22:20:28 -04:00
org.eclipse.cdt.core.tests Bug 573764 - Ambiguous conversion on numeric type 2021-06-26 14:09:08 -04:00
org.eclipse.cdt.core.win32 [releng] Bump to CDT version 10.4.0 2021-06-12 20:52:54 -04:00
org.eclipse.cdt.core.win32.x86_64 [releng] Bump to CDT version 10.4.0 2021-06-12 20:52:54 -04:00
org.eclipse.cdt.ui Bug 574333 - Per-project Doxygen options are not flushed until saved a second time 2021-06-20 00:38:08 -04:00
org.eclipse.cdt.ui.tests [releng] Bump to CDT version 10.4.0 2021-06-12 20:52:54 -04:00
pom.xml [releng] Bump to CDT version 10.4.0 2021-06-12 20:52:54 -04:00