mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 01:06:01 +02:00
![]() 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> |
||
---|---|---|
.. | ||
org.eclipse.cdt.core | ||
org.eclipse.cdt.core.linux | ||
org.eclipse.cdt.core.linux.aarch64 | ||
org.eclipse.cdt.core.linux.ppc64le | ||
org.eclipse.cdt.core.linux.x86_64 | ||
org.eclipse.cdt.core.macosx | ||
org.eclipse.cdt.core.native | ||
org.eclipse.cdt.core.tests | ||
org.eclipse.cdt.core.win32 | ||
org.eclipse.cdt.core.win32.x86_64 | ||
org.eclipse.cdt.ui | ||
org.eclipse.cdt.ui.tests | ||
pom.xml |