diff --git a/cpp/ql/test/duplication-tests/constants/constants.cpp b/cpp/ql/test/duplication-tests/constants/constants.cpp new file mode 100644 index 00000000000..c42a5981387 --- /dev/null +++ b/cpp/ql/test/duplication-tests/constants/constants.cpp @@ -0,0 +1,12 @@ + +int x = int(); +float y = float(); +double z = double(); + +/* This produces a getValueText() of 0 for R() in line 9, which is debatable. */ +struct R {}; +struct S { + S() : S(R()) { } + S(R) { } +}; +S s; diff --git a/cpp/ql/test/duplication-tests/constants/expr.expected b/cpp/ql/test/duplication-tests/constants/expr.expected new file mode 100644 index 00000000000..e860f867a10 --- /dev/null +++ b/cpp/ql/test/duplication-tests/constants/expr.expected @@ -0,0 +1,4 @@ +| constants.cpp:2:9:2:13 | 0 | int() | +| constants.cpp:3:11:3:17 | 0.0 | float() | +| constants.cpp:4:12:4:19 | 0.0 | double() | +| constants.cpp:9:11:9:13 | 0 | 0 | diff --git a/cpp/ql/test/duplication-tests/constants/expr.ql b/cpp/ql/test/duplication-tests/constants/expr.ql new file mode 100644 index 00000000000..09d745df82e --- /dev/null +++ b/cpp/ql/test/duplication-tests/constants/expr.ql @@ -0,0 +1,4 @@ +import cpp + +from Expr e +select e, e.getValueText()