Skip to content

Commit

Permalink
compiler: Disallow rune literals with '\X'.
Browse files Browse the repository at this point in the history
http://golang.org/ref/spec#Rune_literals states	that rune literals
encoded as hex bytes must begin with lowercase '\x'.
Fixes golang/go#11575.

Change-Id: I8b76cd645b0d28dadd8600a0aa31485d439216cb
Reviewed-on: https://go-review.googlesource.com/12158
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
Chris Manghane authored and ianlancetaylor committed Jul 24, 2015
1 parent ac46288 commit 4611738
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion go/lex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,6 @@ Lex::advance_one_char(const char* p, bool is_single_quote, unsigned int* value,
: p + 1);

case 'x':
case 'X':
*is_character = false;
if (Lex::is_hex_digit(p[1]) && Lex::is_hex_digit(p[2]))
{
Expand Down

0 comments on commit 4611738

Please sign in to comment.