Merge branch 'dev' into fix-i314
This commit is contained in:
commit
df9f9fe780
@ -4971,6 +4971,14 @@ static void destructsymbols(symbol *root,int level)
|
||||
/* check that the '~' operator is defined for this tag */
|
||||
operator_symname(symbolname,"~",sym->tag,0,1,0);
|
||||
if ((opsym=findglb(symbolname,sGLOBAL))!=NULL) {
|
||||
if ((opsym->usage & uMISSING)!=0 || (opsym->usage & uPROTOTYPED)==0) {
|
||||
char symname[2*sNAMEMAX+16]; /* allow space for user defined operators */
|
||||
funcdisplayname(symname,opsym->name);
|
||||
if ((opsym->usage & uMISSING)!=0)
|
||||
error(4,symname); /* function not defined */
|
||||
if ((opsym->usage & uPROTOTYPED)==0)
|
||||
error(71,symname); /* operator must be declared before use */
|
||||
} /* if */
|
||||
/* save PRI, in case of a return statment */
|
||||
if (!savepri) {
|
||||
pushreg(sPRI); /* right-hand operand is in PRI */
|
||||
|
@ -80,6 +80,12 @@ set_tests_properties(md_array_size_chk_gh_314 PROPERTIES PASS_REGULAR_EXPRESSION
|
||||
")
|
||||
set_tests_properties(md_array_size_chk_gh_314 PROPERTIES WILL_FAIL TRUE)
|
||||
|
||||
add_compiler_test(destructor_not_impl_gh_310 ${CMAKE_CURRENT_SOURCE_DIR}/destructor_not_impl_gh_310.pwn)
|
||||
set_tests_properties(destructor_not_impl_gh_310 PROPERTIES PASS_REGULAR_EXPRESSION
|
||||
".*\\.pwn\\(6\\) : error 004: function \"operator~(Error:)\" is not implemented
|
||||
")
|
||||
set_tests_properties(destructor_not_impl_gh_310 PROPERTIES WILL_FAIL TRUE)
|
||||
|
||||
# Crashers
|
||||
#
|
||||
# These tests simply check that the compiler doesn't crash.
|
||||
|
4
source/compiler/tests/destructor_not_impl_gh_310.pwn
Normal file
4
source/compiler/tests/destructor_not_impl_gh_310.pwn
Normal file
@ -0,0 +1,4 @@
|
||||
forward operator~(Error:right[], size);
|
||||
main() {
|
||||
new Error:e;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user