library: allow "?" in tr_ML3_MT_MM_ID_Req again

Fix MSC test TC_lu_by_imei, which uses tr_ML3_MT_MM_ID_Req with the
default "?" (AnyElement) parameter. It was failing with the following
runtime error:

Dynamic test case error: Performing a valueof or send operation on a non-specific template of enumerated type @L3_Templates.CmIdentityType.

Fixes: 328984591372ad5abf51655a51d45d880bfed182 ("L3_Templates: add enum CmIdentityType")
Related: https://www.eclipse.org/forums/index.php/t/1099816/
Change-Id: Ie7fbe52ac3c0c8f233680dcc311febec77d2ed0b
diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index 3011919..bc0e797 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -873,6 +873,14 @@
 	}
 }
 
+private function f_id_type_or_any(template CmIdentityType id_type) return template bitstring {
+	if (istemplatekind(id_type, "?")) {
+		return ?;
+	} else {
+		return int2bit(enum2int(valueof(id_type)), 3);
+	}
+}
+
 template PDU_ML3_NW_MS tr_ML3_MT_MM_ID_Req(template CmIdentityType id_type := ?) := {
 	discriminator := '0101'B,
 	tiOrSkip := {
@@ -883,7 +891,7 @@
 			identityRequest := {
 				messageType := '011000'B,
 				nsd := '00'B,
-				identityType := int2bit(enum2int(valueof(id_type)), 3),
+				identityType := f_id_type_or_any(id_type),
 				spare1_5 := ?
 			}
 		}