summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authoremsr <emsr@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-23 16:50:22 +0000
committeremsr <emsr@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-23 16:50:22 +0000
commit4e454776e1a4fcbaed217522178f7fb497cd301d (patch)
tree90c3d98def13763d69f7b449e3eb35a47b01670a /libcpp
parent4805aa90e1f197a8cccd8734ad1b754fa35d0335 (diff)
downloadgcc-4e454776e1a4fcbaed217522178f7fb497cd301d.tar.gz
libcpp/
2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net> * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z; Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14; * init.c (struct lang_flags lang_defaults): Add column for trigraphs; Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs; (cpp_init_builtins): Set __cplusplus to 201402L for C++14; Set __cplusplus to 201500L for C++17. * expr.c (cpp_classify_number): Change C++1y to C++14 in binary constants error message. gcc/c-family/ 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net> * c-common.h (enum cxx_dialect): Add cxx14. * c-opts.c (set_std_cxx1y): Rename to set_std_cxx14; Use cxx14. * c-ubsan.c (ubsan_instrument_shift): Change comment and logic from cxx_dialect == cxx11 || cxx_dialect == cxx1y to cxx_dialect >= cxx11. gcc/cp/ 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net> * decl.c (compute_array_index_type, grokdeclarator, undeduced_auto_decl): Change from cxx1y to cxx14. *lambda.c(add_capture()): Change error message from C++1y to C++14. * parser.c (cp_parser_unqualified_id, cp_parser_pseudo_destructor_name, cp_parser_lambda_introducer, cp_parser_lambda_declarator_opt, cp_parser_decltype, cp_parser_conversion_type_id, cp_parser_simple_type_specifier, cp_parser_type_id_1, cp_parser_template_type_arg, cp_parser_std_attribute, cp_parser_template_declaration_after_export): Ditto. * pt.c (tsubst): Ditto. * semantics.c (force_paren_expr, finish_decltype_type): Ditto. * tree.c: Change comment. * typeck.c (comp_template_parms_position, cxx_sizeof_or_alignof_type, cp_build_addr_expr_1, maybe_warn_about_useless_cast): Ditto. gcc/ 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net> * doc/invoke.texi: Change c++1y to c++14 and gnu++1y to gnu++14. Deprecate c++1y. Change language to reflect greater confidence in C++14. gcc/testsuite/ 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net> * g++.dg/cpp0x/cplusplus.C: New. * g++.dg/cpp0x/cplusplus_0x.C: New. * g++.dg/cpp0x/auto3.C: Change c++1y to c++14. * g++.dg/cpp0x/auto41.C: Ditto. * g++.dg/cpp0x/auto9.C: Ditto. * g++.dg/cpp0x/initlist26.C: Ditto. * g++.dg/cpp0x/pr59111.C: Ditto. * g++.dg/cpp0x/trailing2.C: Ditto. * g++.dg/cpp1y/attr-deprecated.C: Ditto. * g++.dg/cpp1y/auto-dtor1.C: Ditto. * g++.dg/cpp1y/auto-fn1.C: Ditto. * g++.dg/cpp1y/auto-fn2.C: Ditto. * g++.dg/cpp1y/auto-fn3.C: Ditto. * g++.dg/cpp1y/auto-fn4.C: Ditto. * g++.dg/cpp1y/auto-fn5.C: Ditto. * g++.dg/cpp1y/auto-fn6.C: Ditto. * g++.dg/cpp1y/auto-fn7.C: Ditto. * g++.dg/cpp1y/auto-fn8.C: Ditto. * g++.dg/cpp1y/auto-fn9.C: Ditto. * g++.dg/cpp1y/auto-fn10.C: Ditto. * g++.dg/cpp1y/auto-fn11.C: Ditto. * g++.dg/cpp1y/auto-fn12.C: Ditto. * g++.dg/cpp1y/auto-fn13.C: Ditto. * g++.dg/cpp1y/auto-fn14.C: Ditto. * g++.dg/cpp1y/auto-fn15.C: Ditto. * g++.dg/cpp1y/auto-fn16.C: Ditto. * g++.dg/cpp1y/auto-fn17.C: Ditto. * g++.dg/cpp1y/auto-fn18.C: Ditto. * g++.dg/cpp1y/auto-fn19.C: Ditto. * g++.dg/cpp1y/auto-fn20.C: Ditto. * g++.dg/cpp1y/auto-fn21.C: Ditto. * g++.dg/cpp1y/auto-fn22.C: Ditto. * g++.dg/cpp1y/auto-fn23.C: Ditto. * g++.dg/cpp1y/auto-fn24.C: Ditto. * g++.dg/cpp1y/auto-fn25.C: Ditto. * g++.dg/cpp1y/auto-mangle1.C: Ditto. * g++.dg/cpp1y/auto-neg1.C: Ditto. * g++.dg/cpp1y/digit-sep.C: Ditto. * g++.dg/cpp1y/digit-sep-neg.C: Ditto. * g++.dg/cpp1y/digit-sep-cxx11-neg.C: Ditto. * g++.dg/cpp1y/fn-generic-member-ool.C: Ditto. * g++.dg/cpp1y/lambda-deduce-mult.C: Ditto. * g++.dg/cpp1y/lambda-generic.C: Ditto. * g++.dg/cpp1y/lambda-generic-cfun.C: Ditto. * g++.dg/cpp1y/lambda-generic-dep.C: Ditto. * g++.dg/cpp1y/lambda-generic-mixed.C: Ditto. * g++.dg/cpp1y/lambda-generic-udt.C: Ditto. * g++.dg/cpp1y/lambda-generic-variadic.C: Ditto. * g++.dg/cpp1y/lambda-generic-vla1.C: Ditto. * g++.dg/cpp1y/lambda-generic-x.C: Ditto. * g++.dg/cpp1y/lambda-generic-xcfun.C: Ditto. * g++.dg/cpp1y/lambda-generic-xudt.C: Ditto. * g++.dg/cpp1y/lambda-init.C: Ditto. * g++.dg/cpp1y/lambda-init1.C: Ditto. * g++.dg/cpp1y/lambda-init2.C: Ditto. * g++.dg/cpp1y/lambda-init3.C: Ditto. * g++.dg/cpp1y/lambda-init4.C: Ditto. * g++.dg/cpp1y/lambda-init5.C: Ditto. * g++.dg/cpp1y/lambda-init6.C: Ditto. * g++.dg/cpp1y/lambda-init7.C: Ditto. * g++.dg/cpp1y/lambda-init8.C: Ditto. * g++.dg/cpp1y/lambda-init9.C: Ditto. * g++.dg/cpp1y/mangle1.C: Ditto. * g++.dg/cpp1y/pr57640.C: Ditto. * g++.dg/cpp1y/pr57644.C: Ditto. * g++.dg/cpp1y/pr58500.C: Ditto. * g++.dg/cpp1y/pr58533.C: Ditto. * g++.dg/cpp1y/pr58534.C: Ditto. * g++.dg/cpp1y/pr58535.C: Ditto. * g++.dg/cpp1y/pr58536.C: Ditto. * g++.dg/cpp1y/pr58548.C: Ditto. * g++.dg/cpp1y/pr58549.C: Ditto. * g++.dg/cpp1y/pr58637.C: Ditto. * g++.dg/cpp1y/pr58708.C: Ditto. * g++.dg/cpp1y/pr59110.C: Ditto. * g++.dg/cpp1y/pr59112.C: Ditto. * g++.dg/cpp1y/pr59113.C: Ditto. * g++.dg/cpp1y/pr59629.C: Ditto. * g++.dg/cpp1y/pr59635.C: Ditto. * g++.dg/cpp1y/pr59636.C: Ditto. * g++.dg/cpp1y/pr59638.C: Ditto. * g++.dg/cpp1y/pr59867.C: Ditto. * g++.dg/cpp1y/pr60033.C: Ditto. * g++.dg/cpp1y/pr60052.C: Ditto. * g++.dg/cpp1y/pr60053.C: Ditto. * g++.dg/cpp1y/pr60054.C: Ditto. * g++.dg/cpp1y/pr60064.C: Ditto. * g++.dg/cpp1y/pr60065.C: Ditto. * g++.dg/cpp1y/pr60190.C: Ditto. * g++.dg/cpp1y/pr60311.C: Ditto. * g++.dg/cpp1y/pr60332.C: Ditto. * g++.dg/cpp1y/pr60376.C: Ditto. * g++.dg/cpp1y/pr60377.C: Ditto. * g++.dg/cpp1y/pr60384.C: Ditto. * g++.dg/cpp1y/pr60390.C: Ditto. * g++.dg/cpp1y/pr60391.C: Ditto. * g++.dg/cpp1y/pr60393.C: Ditto. * g++.dg/cpp1y/pr60573.C: Ditto. * g++.dg/cpp1y/pr60626.C: Ditto. * g++.dg/cpp1y/pr60627.C: Ditto. * g++.dg/cpp1y/regress1.C: Ditto. * g++.dg/cpp1y/system-binary-constants-1.C: Ditto. * g++.dg/cpp1y/udlit-char-template.C: Ditto. * g++.dg/cpp1y/udlit-char-template-neg.C: Ditto. * g++.dg/cpp1y/udlit-empty-string-neg.C: Ditto. * g++.dg/cpp1y/udlit-enc-prefix-neg.C: Ditto. * g++.dg/cpp1y/udlit-userdef-string.C: Ditto. * g++.dg/cpp1y/var-templ1.C: Ditto. * g++.dg/cpp1y/var-templ2.C: Ditto. * g++.dg/cpp1y/var-templ3.C: Ditto. * g++.dg/cpp1y/var-templ4.C: Ditto. * g++.dg/cpp1y/var-templ5.C: Ditto. * g++.dg/cpp1y/var-templ6.C: Ditto. * g++.dg/cpp1y/var-templ7.C: Ditto. * g++.dg/cpp1y/vla1.C: Ditto. * g++.dg/cpp1y/vla2.C: Ditto. * g++.dg/cpp1y/vla3.C: Ditto. * g++.dg/cpp1y/vla4.C: Ditto. * g++.dg/cpp1y/vla5.C: Ditto. * g++.dg/cpp1y/vla8.C: Ditto. * g++.dg/cpp1y/vla9.C: Ditto. * g++.dg/cpp1y/vla10.C: Ditto. * g++.dg/cpp1y/vla11.C: Ditto. * g++.dg/cpp1y/vla12.C: Ditto. * g++.dg/cpp1y/vla13.C: Ditto. * g++.dg/cpp1y/vla-initlist1.C: Ditto. * g++.dg/ext/vector23.C: Ditto. * g++.dg/ext/vla11.C: Ditto. * gcc/testsuite/g++.dg/ubsan/cxx1y-vla.C: Ditto. * g++.dg/warn/Wvla-2.C: Ditto. * g++.dg/debug/dwarf2/auto1.C: Ditto. * g++.dg/cpp1z/typename-tmpl-tmpl-parm-ped-neg.C: Ditto. * g++.dg/cpp1y/cplusplus.C: Check for exact date. * g++.dg/cpp1y/system-binary-constants-1.C: Check C++14 instead of C++1y in error message. * g++.dg/system-binary-constants-1.C: Ditto. * g++.dg/cpp1y/cplusplus_1y.C: New. * g++.dg/cpp1z/cplusplus.C: New. * lib/target-supports.exp: (check_effective_target_c++1y*): Rename to check_effective_target_c++14* (check_effective_target_c++11_only): Call check_effective_target_c++14; (check_effective_target_c++11_down): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214400 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog11
-rw-r--r--libcpp/expr.c2
-rw-r--r--libcpp/include/cpplib.h2
-rw-r--r--libcpp/init.c50
4 files changed, 42 insertions, 23 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 89c840658f0..1b4e31d6be2 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,14 @@
+2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
+
+ * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Z, CLK_CXX1Z;
+ Rename CLK_GNUCXX1Y, CLK_CXX1Y to CLK_GNUCXX14, CLK_CXX14;
+ * init.c (struct lang_flags lang_defaults): Add column for trigraphs;
+ Add rows for CLK_GNUCXX1Z, CLK_CXX1Z; (cpp_set_lang): Set trigraphs;
+ (cpp_init_builtins): Set __cplusplus to 201402L for C++14;
+ Set __cplusplus to 201500L for C++17.
+ * expr.c (cpp_classify_number): Change C++1y to C++14 in binary
+ constants error message.
+
2014-08-20 Marek Polacek <polacek@redhat.com>
* include/cpplib.h (cpp_options): Use signed char.
diff --git a/libcpp/expr.c b/libcpp/expr.c
index 147bd97c5ec..07f1b2fb419 100644
--- a/libcpp/expr.c
+++ b/libcpp/expr.c
@@ -687,7 +687,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token,
&& CPP_PEDANTIC (pfile))
cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0,
CPP_OPTION (pfile, cplusplus)
- ? "binary constants are a C++1y feature "
+ ? "binary constants are a C++14 feature "
"or GCC extension"
: "binary constants are a GCC extension");
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index 9f87ff8b514..28fc0f8965f 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -166,7 +166,7 @@ enum cpp_ttype
enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_GNUC11,
CLK_STDC89, CLK_STDC94, CLK_STDC99, CLK_STDC11,
CLK_GNUCXX, CLK_CXX98, CLK_GNUCXX11, CLK_CXX11,
- CLK_GNUCXX1Y, CLK_CXX1Y, CLK_ASM};
+ CLK_GNUCXX14, CLK_CXX14, CLK_GNUCXX1Z, CLK_CXX1Z, CLK_ASM};
/* Payload of a NUMBER, STRING, CHAR or COMMENT token. */
struct GTY(()) cpp_string {
diff --git a/libcpp/init.c b/libcpp/init.c
index b80951544d4..0d2f73718be 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -90,26 +90,29 @@ struct lang_flags
char user_literals;
char binary_constants;
char digit_separators;
+ char trigraphs;
};
static const struct lang_flags lang_defaults[] =
-{ /* c99 c++ xnum xid c11 std // digr ulit rlit udlit bin_cst dig_sep */
- /* GNUC89 */ { 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
- /* GNUC99 */ { 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0 },
- /* GNUC11 */ { 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0 },
- /* STDC89 */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 },
- /* STDC94 */ { 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0 },
- /* STDC99 */ { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0 },
- /* STDC11 */ { 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 },
- /* GNUCXX */ { 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
- /* CXX98 */ { 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0 },
- /* GNUCXX11 */ { 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0 },
- /* CXX11 */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
- /* GNUCXX1Y */ { 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 },
- /* CXX1Y */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
- /* ASM */ { 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }
+{ /* c99 c++ xnum xid c11 std // digr ulit rlit udlit bincst digsep trig */
+ /* GNUC89 */ { 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 },
+ /* GNUC99 */ { 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
+ /* GNUC11 */ { 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
+ /* STDC89 */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1 },
+ /* STDC94 */ { 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1 },
+ /* STDC99 */ { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1 },
+ /* STDC11 */ { 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1 },
+ /* GNUCXX */ { 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 },
+ /* CXX98 */ { 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1 },
+ /* GNUCXX11 */ { 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0 },
+ /* CXX11 */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1 },
+ /* GNUCXX14 */ { 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0 },
+ /* CXX14 */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+ /* GNUCXX1Z */ { 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0 },
+ /* CXX1Z */ { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
+ /* ASM */ { 0, 0, 1, 0, 0, 0, 1, 0, 0, 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
+ GNUCXX14, and CXX14 when no longer experimental (when all uses of
identifiers in the compiler have been audited for correct handling
of extended identifiers). */
};
@@ -128,7 +131,6 @@ cpp_set_lang (cpp_reader *pfile, enum c_lang lang)
CPP_OPTION (pfile, extended_identifiers) = l->extended_identifiers;
CPP_OPTION (pfile, c11_identifiers) = l->c11_identifiers;
CPP_OPTION (pfile, std) = l->std;
- CPP_OPTION (pfile, trigraphs) = l->std;
CPP_OPTION (pfile, cplusplus_comments) = l->cplusplus_comments;
CPP_OPTION (pfile, digraphs) = l->digraphs;
CPP_OPTION (pfile, uliterals) = l->uliterals;
@@ -136,6 +138,7 @@ cpp_set_lang (cpp_reader *pfile, enum c_lang lang)
CPP_OPTION (pfile, user_literals) = l->user_literals;
CPP_OPTION (pfile, binary_constants) = l->binary_constants;
CPP_OPTION (pfile, digit_separators) = l->digit_separators;
+ CPP_OPTION (pfile, trigraphs) = l->trigraphs;
}
/* Initialize library global state. */
@@ -489,9 +492,12 @@ cpp_init_builtins (cpp_reader *pfile, int hosted)
if (CPP_OPTION (pfile, cplusplus))
{
- if (CPP_OPTION (pfile, lang) == CLK_CXX1Y
- || CPP_OPTION (pfile, lang) == CLK_GNUCXX1Y)
- _cpp_define_builtin (pfile, "__cplusplus 201300L");
+ if (CPP_OPTION (pfile, lang) == CLK_CXX1Z
+ || CPP_OPTION (pfile, lang) == CLK_GNUCXX1Z)
+ _cpp_define_builtin (pfile, "__cplusplus 201500L");
+ else if (CPP_OPTION (pfile, lang) == CLK_CXX14
+ || CPP_OPTION (pfile, lang) == CLK_GNUCXX14)
+ _cpp_define_builtin (pfile, "__cplusplus 201402L");
else if (CPP_OPTION (pfile, lang) == CLK_CXX11
|| CPP_OPTION (pfile, lang) == CLK_GNUCXX11)
_cpp_define_builtin (pfile, "__cplusplus 201103L");
@@ -509,7 +515,9 @@ cpp_init_builtins (cpp_reader *pfile, int hosted)
_cpp_define_builtin (pfile, "__STDC_VERSION__ 199901L");
if (CPP_OPTION (pfile, uliterals)
- && !CPP_OPTION (pfile, cplusplus))
+ && !(CPP_OPTION (pfile, cplusplus)
+ && (CPP_OPTION (pfile, lang) == CLK_GNUCXX
+ || CPP_OPTION (pfile, lang) == CLK_CXX98)))
{
_cpp_define_builtin (pfile, "__STDC_UTF_16__ 1");
_cpp_define_builtin (pfile, "__STDC_UTF_32__ 1");