Skip to content

Commit

Permalink
fix Issue 11759 - Poor error message trying to use lowercase L in lit…
Browse files Browse the repository at this point in the history
…eral suffix
  • Loading branch information
9rnsr committed Dec 18, 2013
1 parent 00e4068 commit e1d1790
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lexer.c
Expand Up @@ -2009,14 +2009,20 @@ TOK Lexer::number(Token *t)
// Parse trailing 'u', 'U', 'l' or 'L' in any combination
const utf8_t *psuffix = p;
while (1)
{ utf8_t f;

{
utf8_t f;
switch (*p)
{ case 'U':
{
case 'U':
case 'u':
f = FLAGS_unsigned;
goto L1;

case 'l':
f = FLAGS_long;
error("Lower case integer suffix 'l' is not allowed. Please use 'L' instead");
goto L1;

case 'L':
f = FLAGS_long;
L1:
Expand Down
8 changes: 8 additions & 0 deletions test/fail_compilation/diag11759.d
@@ -0,0 +1,8 @@
/*
TEST_OUTPUT:
---
fail_compilation/diag11759.d(8): Error: Lower case integer suffix 'l' is not allowed. Please use 'L' instead
---
*/

ulong x = 123ul;

0 comments on commit e1d1790

Please sign in to comment.