X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fcp%2Fdecl.c;h=495660dec2947e05f5b3ca9de49cb30aadf4a0bc;hb=6388cfe24f7ecbdc2ba2d4c80638ea6c95ba07c2;hp=95ae8ebbe0fad046f506d02e2dcfa786c8c0b049;hpb=976d38860d53e2fc538d130de111346d5e62682f;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 95ae8ebbe0f..495660dec29 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -33,8 +33,6 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tm.h" #include "tree.h" -#include "rtl.h" -#include "expr.h" #include "flags.h" #include "cp-tree.h" #include "tree-iterator.h" @@ -55,6 +53,7 @@ along with GCC; see the file COPYING3. If not see #include "timevar.h" #include "tree-flow.h" #include "pointer-set.h" +#include "splay-tree.h" #include "plugin.h" static tree grokparms (tree parmlist, tree *); @@ -5278,7 +5277,6 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) error ("in C++98 %qD must be initialized by constructor, " "not by %<{...}%>", decl); - init = build_tree_list (NULL_TREE, init); } else if (TREE_CODE (type) == VECTOR_TYPE && TYPE_VECTOR_OPAQUE (type)) { @@ -7703,6 +7701,7 @@ grokdeclarator (const cp_declarator *declarator, { tree type = NULL_TREE; int longlong = 0; + int explicit_int128 = 0; int virtualp, explicitp, friendp, inlinep, staticp; int explicit_int = 0; int explicit_char = 0; @@ -7766,6 +7765,7 @@ grokdeclarator (const cp_declarator *declarator, short_p = declspecs->specs[(int)ds_short]; long_p = declspecs->specs[(int)ds_long]; longlong = declspecs->specs[(int)ds_long] >= 2; + explicit_int128 = declspecs->explicit_int128_p; thread_p = declspecs->specs[(int)ds_thread]; if (decl_context == FUNCDEF) @@ -8094,12 +8094,16 @@ grokdeclarator (const cp_declarator *declarator, error ("% and % specified together for %qs", name); else if (longlong && TREE_CODE (type) != INTEGER_TYPE) error ("% invalid for %qs", name); + else if (explicit_int128 && TREE_CODE (type) != INTEGER_TYPE) + error ("%<__int128%> invalid for %qs", name); else if (long_p && TREE_CODE (type) == REAL_TYPE) error ("% invalid for %qs", name); else if (short_p && TREE_CODE (type) == REAL_TYPE) error ("% invalid for %qs", name); else if ((long_p || short_p) && TREE_CODE (type) != INTEGER_TYPE) error ("% or % invalid for %qs", name); + else if ((long_p || short_p || explicit_char || explicit_int) && explicit_int128) + error ("%, %, %, or % invalid for %qs", name); else if ((long_p || short_p) && explicit_char) error ("% or % specified with char for %qs", name); else if (long_p && short_p) @@ -8114,7 +8118,7 @@ grokdeclarator (const cp_declarator *declarator, else { ok = 1; - if (!explicit_int && !defaulted_int && !explicit_char && pedantic) + if (!explicit_int && !defaulted_int && !explicit_char && !explicit_int128 && pedantic) { pedwarn (input_location, OPT_pedantic, "long, short, signed or unsigned used invalidly for %qs", @@ -8122,6 +8126,22 @@ grokdeclarator (const cp_declarator *declarator, if (flag_pedantic_errors) ok = 0; } + if (explicit_int128) + { + if (int128_integer_type_node == NULL_TREE) + { + error ("%<__int128%> is not supported by this target"); + ok = 0; + } + else if (pedantic) + { + pedwarn (input_location, OPT_pedantic, + "ISO C++ does not support %<__int128%> for %qs", + name); + if (flag_pedantic_errors) + ok = 0; + } + } } /* Discard the type modifiers if they are invalid. */ @@ -8132,6 +8152,7 @@ grokdeclarator (const cp_declarator *declarator, long_p = false; short_p = false; longlong = 0; + explicit_int128 = false; } } @@ -8156,7 +8177,9 @@ grokdeclarator (const cp_declarator *declarator, && TREE_CODE (type) == INTEGER_TYPE && !same_type_p (TYPE_MAIN_VARIANT (type), wchar_type_node))) { - if (longlong) + if (explicit_int128) + type = int128_unsigned_type_node; + else if (longlong) type = long_long_unsigned_type_node; else if (long_p) type = long_unsigned_type_node; @@ -8171,6 +8194,8 @@ grokdeclarator (const cp_declarator *declarator, } else if (signed_p && type == char_type_node) type = signed_char_type_node; + else if (explicit_int128) + type = int128_integer_type_node; else if (longlong) type = long_long_integer_type_node; else if (long_p) @@ -8186,8 +8211,7 @@ grokdeclarator (const cp_declarator *declarator, "complex double", but if any modifiers at all are specified it is the complex form of TYPE. E.g, "complex short" is "complex short int". */ - - else if (defaulted_int && ! longlong + else if (defaulted_int && ! longlong && ! explicit_int128 && ! (long_p || short_p || signed_p || unsigned_p)) type = complex_double_type_node; else if (type == integer_type_node)