This patch corrects an error message directive which did not
escape the { character. The patch also contains test cases
to stress set declaration errors.
gcc/m2/ChangeLog:
PR modula2/114422
* gm2-compiler/M2Quads.mod (BuildConstructor): Add escape
character.
gcc/testsuite/ChangeLog:
PR modula2/114422
* gm2/iso/fail/badset.mod: New test.
* gm2/iso/fail/badset2.mod: New test.
* gm2/iso/fail/badset3.mod: New test.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
IF type = NulSym
THEN
MetaErrorT0 (tokcbrpos,
- '{%E}constructor requires a type before the opening {')
+ '{%E}constructor requires a type before the opening %{')
ELSE
ChangeToConstructor (tok, type) ;
PutConstructorFrom (constValue, type) ;
--- /dev/null
+MODULE badset ;
+
+VAR
+ set: set ;
+BEGIN
+
+END badset.
--- /dev/null
+MODULE badset2 ;
+
+TYPE
+ userset = SET OF CHAR ;
+VAR
+ set: userset ;
+BEGIN
+ set := set {}
+END badset2.
--- /dev/null
+MODULE badset3 ;
+
+TYPE
+ userset = SET OF CHAR ;
+VAR
+ set: userset ;
+BEGIN
+ set := unknown {}
+END badset3.