Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2019-06-28 01:23:10 +0000
committerNathan Ridge2019-07-02 19:20:42 +0000
commitfe003c3b8f3846699edd4018aaba534adc8a16b5 (patch)
tree5cc9d5c930ec15ab38e31f2e339541b8f1d97e90 /core/org.eclipse.cdt.core.tests
parent35a1923321902e9348a6f8181ff4a4b8b279d39b (diff)
downloadorg.eclipse.cdt-fe003c3b8f3846699edd4018aaba534adc8a16b5.tar.gz
org.eclipse.cdt-fe003c3b8f3846699edd4018aaba534adc8a16b5.tar.xz
org.eclipse.cdt-fe003c3b8f3846699edd4018aaba534adc8a16b5.zip
Bug 548700 - Handle prefix negative sign in FloatingPointValue.parseDouble()
While a literal expression itself will never be negative (the negative sign is parsed as a unary operator), we also use FloatingPointValue to represent results during value computations which can be negative. Change-Id: I16227b2d19256066b094ae60476e124b4bcea14d
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/FloatingPointValueTests.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/FloatingPointValueTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/FloatingPointValueTests.java
index d17f8b3b7ed..2727a202128 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/FloatingPointValueTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/FloatingPointValueTests.java
@@ -39,6 +39,11 @@ public class FloatingPointValueTests extends TestBase {
assertEvaluationEquals(2.5);
}
+ // constexpr auto x = -2.5;
+ public void testNegativeDoubleLiteral() throws Exception {
+ assertEvaluationEquals(-2.5);
+ }
+
// constexpr auto x = .5f;
public void testFloatLiteral() throws Exception {
assertEvaluationEquals(0.5);

Back to the top