Merge pull request #312 from YashasSamaga/fix-i308
fix result propagation in constexpr operator chains
This commit is contained in:
commit
da9d65057a
@ -512,6 +512,7 @@ static int plnge_rel(int *opstr,int opoff,int (*hier)(value *lval),value *lval)
|
|||||||
error(212);
|
error(212);
|
||||||
if (count>0) {
|
if (count>0) {
|
||||||
relop_prefix();
|
relop_prefix();
|
||||||
|
lval2.boolresult=lval->boolresult;
|
||||||
*lval=lval2; /* copy right hand expression of the previous iteration */
|
*lval=lval2; /* copy right hand expression of the previous iteration */
|
||||||
} /* if */
|
} /* if */
|
||||||
opidx+=opoff;
|
opidx+=opoff;
|
||||||
|
@ -52,6 +52,14 @@ set_tests_properties(meaningless_class_specifiers_gh_172 PROPERTIES PASS_REGULAR
|
|||||||
.*\\.pwn\\(1 \\-\\- 2\\) : warning 238: meaningless combination of class specifiers \\(const variable arguments\\)
|
.*\\.pwn\\(1 \\-\\- 2\\) : warning 238: meaningless combination of class specifiers \\(const variable arguments\\)
|
||||||
")
|
")
|
||||||
|
|
||||||
|
add_compiler_test(constexpr_result_prop_gh_308 ${CMAKE_CURRENT_SOURCE_DIR}/constexpr_result_prop_gh_308.pwn)
|
||||||
|
set_tests_properties(constexpr_result_prop_gh_308 PROPERTIES PASS_REGULAR_EXPRESSION
|
||||||
|
".*\\.pwn\\(2\\) : warning 237: user warning: \\\"Test passed.\\\"
|
||||||
|
.*\\.pwn\\(6\\) : warning 237: user warning: \\\"Test passed.\\\"
|
||||||
|
.*\\.pwn\\(10\\) : warning 237: user warning: \\\"Test passed.\\\"
|
||||||
|
.*\\.pwn\\(14\\) : warning 237: user warning: \\\"Test passed.\\\"
|
||||||
|
")
|
||||||
|
|
||||||
add_compiler_test(const_array_args_and_literals_gh_276 ${CMAKE_CURRENT_SOURCE_DIR}/const_array_args_and_literals_gh_276.pwn)
|
add_compiler_test(const_array_args_and_literals_gh_276 ${CMAKE_CURRENT_SOURCE_DIR}/const_array_args_and_literals_gh_276.pwn)
|
||||||
set_tests_properties(const_array_args_and_literals_gh_276 PROPERTIES PASS_REGULAR_EXPRESSION
|
set_tests_properties(const_array_args_and_literals_gh_276 PROPERTIES PASS_REGULAR_EXPRESSION
|
||||||
".*\\.pwn\\(13\\) : warning 214: possibly a \\\"const\\\" array argument was intended: \\\"arr\\\"
|
".*\\.pwn\\(13\\) : warning 214: possibly a \\\"const\\\" array argument was intended: \\\"arr\\\"
|
||||||
|
19
source/compiler/tests/constexpr_result_prop_gh_308.pwn
Normal file
19
source/compiler/tests/constexpr_result_prop_gh_308.pwn
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#if (30 < 40 < 50)
|
||||||
|
#warning "Test passed."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !(30 < 40 < 35)
|
||||||
|
#warning "Test passed."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (30 < 40)
|
||||||
|
#warning "Test passed."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !(40 < 35)
|
||||||
|
#warning "Test passed."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
main () {
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user