aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorEdward Smith-Rowland <3dw4rd@verizon.net>2015-03-17 00:50:55 +0000
committerEdward Smith-Rowland <emsr@gcc.gnu.org>2015-03-17 00:50:55 +0000
commita5858a3dfff043b6693ab4b59ee5a41d3e20bad7 (patch)
tree38dfcce3281f3ac2a7852f6219bf0a7d6d8dee9f /libcpp
parentec19b718ba4ebbb6148c3837a1a6f37c4a04bafd (diff)
downloadgcc-a5858a3dfff043b6693ab4b59ee5a41d3e20bad7.zip
gcc-a5858a3dfff043b6693ab4b59ee5a41d3e20bad7.tar.gz
gcc-a5858a3dfff043b6693ab4b59ee5a41d3e20bad7.tar.bz2
re PR c++/64626 (C++14 single quote should not always be a digit separator)
libcpp/ 2015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net> PR c++/64626 * lex.c (lex_number): If a number ends with digit-seps (') skip back and let lex_string take them. gcc/testsuite/ 2015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net> PR c++/64626 g++.dg/cpp1y/pr64626-1.C: New. g++.dg/cpp1y/pr64626-2.C: New. g++.dg/cpp1y/digit-sep-neg.C: Adjust errors and warnings. From-SVN: r221470
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/lex.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 2d84835..c759949 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-16 Edward Smith-Rowland <3dw4rd@verizon.net>
+
+ PR c++/64626
+ * lex.c (lex_number): If a number ends with digit-seps (') skip back
+ and let lex_string take them.
+
2015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
PR target/65261
diff --git a/libcpp/lex.c b/libcpp/lex.c
index 0dc4737..bca5629 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -1400,6 +1400,9 @@ lex_number (cpp_reader *pfile, cpp_string *number,
NORMALIZE_STATE_UPDATE_IDNUM (nst, *cur);
cur++;
}
+ /* A number can't end with a digit separator. */
+ while (cur > pfile->buffer->cur && DIGIT_SEP (cur[-1]))
+ --cur;
pfile->buffer->cur = cur;
}