Skip to content

Commit

Permalink
Fix Issue 10805 - wrong error message for wrong delimited string
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Nov 17, 2013
1 parent e40eb9e commit ec1505d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lexer.c
Expand Up @@ -1585,6 +1585,8 @@ TOK Lexer::delimitedStringConstant(Token *t)
Ldone:
if (*p == '"')
p++;
else if (hereid)
error("delimited string must end in %s\"", hereid->toChars());
else
error("delimited string must end in %c\"", delimright);
t->len = stringbuffer.offset;
Expand Down
12 changes: 12 additions & 0 deletions test/fail_compilation/diag10805.d
@@ -0,0 +1,12 @@
/*
TEST_OUTPUT:
---
fail_compilation/diag10805.d(10): Error: delimited string must end in FOO"
fail_compilation/diag10805.d(12): Error: unterminated string constant starting at fail_compilation/diag10805.d(12)
fail_compilation/diag10805.d(13): Error: semicolon expected following auto declaration, not 'EOF'
---
*/

enum s = q"FOO
FOO
";

0 comments on commit ec1505d

Please sign in to comment.