diff --git a/compiler2/ttcn3/AST_ttcn3.cc b/compiler2/ttcn3/AST_ttcn3.cc index 97477618ef78658208f49e1ce6c2246214ce0e31..7daa287e20445ad3bcd1e13626044d759b91fa88 100644 --- a/compiler2/ttcn3/AST_ttcn3.cc +++ b/compiler2/ttcn3/AST_ttcn3.cc @@ -8831,7 +8831,7 @@ namespace Ttcn { Value *v = ap_template->get_Value(); v->set_my_governor(type); type->chk_this_value_ref(v); - type->chk_this_value(v, 0, exp_val, INCOMPLETE_NOT_ALLOWED, + type->chk_this_value(v, 0, exp_val, WARNING_FOR_INCOMPLETE, OMIT_NOT_ALLOWED, SUB_CHK); return new ActualPar(v); } else { diff --git a/regression_test/compileonly/Bug552232/.gitignore b/regression_test/compileonly/Bug552232/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..6da8ecdaa5dbfaa70827b6a19358d21fe605b888 --- /dev/null +++ b/regression_test/compileonly/Bug552232/.gitignore @@ -0,0 +1,4 @@ +Bug552232 +Bug552232.exe +Bug552232*.cc +Bug552232*.hh diff --git a/regression_test/compileonly/Bug552232/Bug552232.ttcn b/regression_test/compileonly/Bug552232/Bug552232.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75b1670c3557dc34eed376c88b4d759249cac3e1 --- /dev/null +++ b/regression_test/compileonly/Bug552232/Bug552232.ttcn @@ -0,0 +1,38 @@ +/****************************************************************************** + * Copyright (c) 2000-2019 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html + * + * Contributors: + * Baranyi, Botond + * + ******************************************************************************/ + +// actual parameters (including default values) should not produce semantic errors +// if they are not completely initialized (bug 552232) +module Bug552232 { + +type record Rec { + integer a, + charstring b +} + +const Rec c_rec := { 2 } + +function f_test(in Rec pl_rec := { 2 }) +{ + log(pl_rec); +} + +function f() { + var Rec vl_m := { 2 } + + f_test(vl_m); + f_test(-); + f_test(Rec: { 2 }); + f_test(c_rec); +} + +} diff --git a/regression_test/compileonly/Bug552232/Makefile b/regression_test/compileonly/Bug552232/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..0843921d63ef48b9caf96a3f3a5a22ee681821b0 --- /dev/null +++ b/regression_test/compileonly/Bug552232/Makefile @@ -0,0 +1,50 @@ +############################################################################## +# Copyright (c) 2000-2019 Ericsson Telecom AB +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html +# +# Contributors: +# Botond, Baranyi +# +############################################################################## +TOPDIR := ../.. +include $(TOPDIR)/Makefile.regression + +.PHONY: all clean dep + +TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX) + +TTCN3_MODULES = Bug552232.ttcn + +GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) +GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh) +ifdef CODE_SPLIT +GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc)) +else ifdef SPLIT_TO_SLICES +POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_)) +POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc)) +GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES))) +GENERATED_SOURCES += $(GENERATED_SOURCES2) +endif + +OBJECTS = $(GENERATED_SOURCES:.cc=.o) + +TARGET = Bug552232$(EXESUFFIX) + +all: $(TARGET) + +$(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \ + -L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS) + +$(GENERATED_SOURCES) $(GENERATED_HEADERS): $(TTCN3_MODULES) + $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ + +clean distclean: + $(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \ + $(GENERATED_SOURCES) compile *.log + +dep: $(GENERATED_SOURCES) + makedepend $(CPPFLAGS) $(GENERATED_SOURCES)