summaryrefslogtreecommitdiff
path: root/libcpp/internal.h
diff options
context:
space:
mode:
authoremsr <emsr@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-31 14:01:23 +0000
committeremsr <emsr@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-31 14:01:23 +0000
commit4d6f7dd43cda2a90d875712b7e22b6f97507a48d (patch)
tree28dc58242b9d84a0f1723c9f24e40c623e194ef1 /libcpp/internal.h
parent240dbaf411d5fbb983ab0f10da673160fee4e4fa (diff)
downloadgcc-4d6f7dd43cda2a90d875712b7e22b6f97507a48d.tar.gz
libcpp:
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net> Implement C++14 digit separators. * include/cpplib.h (cpp_options): Add digit_separators flag. * internal.h (DIGIT_SEP(c)): New macro. * expr.c (cpp_classify_number): Check improper placement of digit sep; (cpp_interpret_integer): Skip over digit separators. * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add digit separator flags per language; (cpp_set_lang): Set digit_separators * lex.c (lex_number): Add digits separator to allowable characters for C++14. gcc/c-family: 2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net> Implement C++14 digit separators. * c-lex.c (interpret_float): Remove digit separators from scratch string before building real literal. gcc/testsuite: 2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net> Implement C++14 digit separators. * g++.dg/cpp1y/digit-sep.C: New. * g++.dg/cpp1y/digit-sep-neg.C: New. * g++.dg/cpp1y/digit-sep-cxx11-neg.C: New. libstdc++-v3: 2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net> Implement C++14 digit separators. * include/include/bits/parse_numbers.h: Change struct _Digit<_Base, '`'> to struct _Digit<_Base, '\''>. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204260 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/internal.h')
-rw-r--r--libcpp/internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libcpp/internal.h b/libcpp/internal.h
index 1226dbd982b..6de44ed3556 100644
--- a/libcpp/internal.h
+++ b/libcpp/internal.h
@@ -59,6 +59,8 @@ struct cset_converter
|| (((prevc) == 'p' || (prevc) == 'P') \
&& CPP_OPTION (pfile, extended_numbers))))
+#define DIGIT_SEP(c) ((c) == '\'' && CPP_OPTION (pfile, digit_separators))
+
#define CPP_OPTION(PFILE, OPTION) ((PFILE)->opts.OPTION)
#define CPP_BUFFER(PFILE) ((PFILE)->buffer)
#define CPP_BUF_COLUMN(BUF, CUR) ((CUR) - (BUF)->line_base)