summaryrefslogtreecommitdiff
path: root/libcpp/init.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-28 21:36:57 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-28 21:36:57 +0000
commitd8c8614f4367003c5a82be24dcbba4ad83835c63 (patch)
treebefd3b677796bad370f79def6822510edc236a34 /libcpp/init.c
parent0c0d26605077f30f0d07dda0b930da94b1fff3bd (diff)
downloadgcc-d8c8614f4367003c5a82be24dcbba4ad83835c63.tar.gz
N3472 binary constants
* include/cpplib.h (struct cpp_options): Fix a typo in user_literals field comment. Add binary_constants field. * init.c (struct lang_flags): Add binary_constants field. (lang_defaults): Add bin_cst column to the table. (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants). * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x in diagnostics. Accept binary constants if CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust pedwarn message. * g++.dg/cpp/limits.C: Adjust warning wording. * g++.dg/system-binary-constants-1.C: Likewise. * g++.dg/cpp1y/system-binary-constants-1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198380 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/init.c')
-rw-r--r--libcpp/init.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/libcpp/init.c b/libcpp/init.c
index c3fa4af178b..97510003dd8 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -83,24 +83,25 @@ struct lang_flags
char uliterals;
char rliterals;
char user_literals;
+ char binary_constants;
};
static const struct lang_flags lang_defaults[] =
-{ /* c99 c++ xnum xid std // digr ulit rlit user_literals */
- /* GNUC89 */ { 0, 0, 1, 0, 0, 1, 1, 0, 0, 0 },
- /* GNUC99 */ { 1, 0, 1, 0, 0, 1, 1, 1, 1, 0 },
- /* GNUC11 */ { 1, 0, 1, 0, 0, 1, 1, 1, 1, 0 },
- /* STDC89 */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 },
- /* STDC94 */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0 },
- /* STDC99 */ { 1, 0, 1, 0, 1, 1, 1, 0, 0, 0 },
- /* STDC11 */ { 1, 0, 1, 0, 1, 1, 1, 1, 0, 0 },
- /* GNUCXX */ { 0, 1, 1, 0, 0, 1, 1, 0, 0, 0 },
- /* CXX98 */ { 0, 1, 1, 0, 1, 1, 1, 0, 0, 0 },
- /* GNUCXX11 */ { 1, 1, 1, 0, 0, 1, 1, 1, 1, 1 },
- /* CXX11 */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1 },
- /* GNUCXX1Y */ { 1, 1, 1, 0, 0, 1, 1, 1, 1, 1 },
- /* CXX1Y */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1 },
- /* ASM */ { 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }
+{ /* c99 c++ xnum xid std // digr ulit rlit udlit bin_cst */
+ /* GNUC89 */ { 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0 },
+ /* GNUC99 */ { 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0 },
+ /* GNUC11 */ { 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0 },
+ /* STDC89 */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
+ /* STDC94 */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0 },
+ /* STDC99 */ { 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0 },
+ /* STDC11 */ { 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0 },
+ /* GNUCXX */ { 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 },
+ /* CXX98 */ { 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0 },
+ /* GNUCXX11 */ { 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0 },
+ /* CXX11 */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0 },
+ /* GNUCXX1Y */ { 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1 },
+ /* CXX1Y */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1 },
+ /* ASM */ { 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 }
/* xid should be 1 for GNUC99, STDC99, GNUCXX, CXX98, GNUCXX11, CXX11,
GNUCXX1Y, and CXX1Y when no longer experimental (when all uses of
identifiers in the compiler have been audited for correct handling
@@ -126,6 +127,7 @@ cpp_set_lang (cpp_reader *pfile, enum c_lang lang)
CPP_OPTION (pfile, uliterals) = l->uliterals;
CPP_OPTION (pfile, rliterals) = l->rliterals;
CPP_OPTION (pfile, user_literals) = l->user_literals;
+ CPP_OPTION (pfile, binary_constants) = l->binary_constants;
}
/* Initialize library global state. */