diff options
Diffstat (limited to 'contrib/gcc/cp/decl.c')
-rw-r--r-- | contrib/gcc/cp/decl.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/contrib/gcc/cp/decl.c b/contrib/gcc/cp/decl.c index 4e3c6e9..58128aa 100644 --- a/contrib/gcc/cp/decl.c +++ b/contrib/gcc/cp/decl.c @@ -3158,12 +3158,6 @@ cxx_init_decl_processing (void) if (flag_inline_functions) flag_inline_trees = 2; - /* Force minimum function alignment if using the least significant - bit of function pointers to store the virtual bit. */ - if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn - && force_align_functions_log < 1) - force_align_functions_log = 1; - /* Initially, C. */ current_lang_name = lang_name_c; @@ -4966,9 +4960,9 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) { gcc_assert (TREE_STATIC (decl)); /* An in-class declaration of a static data member should be - external; it is only a declaration, and not a definition. */ - if (init == NULL_TREE) - gcc_assert (DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)); + external; it is only a declaration, and not a definition. */ + if (init == NULL_TREE && DECL_INITIAL (decl) == NULL_TREE) + gcc_assert (DECL_EXTERNAL (decl)); } /* We don't create any RTL for local variables. */ @@ -6065,6 +6059,14 @@ grokfndecl (tree ctype, if (TYPE_VOLATILE (type)) TREE_THIS_VOLATILE (decl) = 1; + /* If pointers to member functions use the least significant bit to + indicate whether a function is virtual, ensure a pointer + to this function will have that bit clear. */ + if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn + && TREE_CODE (type) == METHOD_TYPE + && DECL_ALIGN (decl) < 2 * BITS_PER_UNIT) + DECL_ALIGN (decl) = 2 * BITS_PER_UNIT; + if (friendp && TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR) { @@ -6702,12 +6704,21 @@ compute_array_index_type (tree name, tree size) error ("size of array is not an integral constant-expression"); size = integer_one_node; } - else if (pedantic) + else if (pedantic && warn_vla != 0) + { + if (name) + pedwarn ("ISO C++ forbids variable length array %qD", name); + else + pedwarn ("ISO C++ forbids variable length array"); + } + else if (warn_vla > 0) { if (name) - pedwarn ("ISO C++ forbids variable-size array %qD", name); + warning (OPT_Wvla, + "variable length array %qD is used", name); else - pedwarn ("ISO C++ forbids variable-size array"); + warning (OPT_Wvla, + "variable length array is used"); } if (processing_template_decl && !TREE_CONSTANT (size)) |