diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-06-29 14:28:24 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-06-29 14:28:24 +0000 |
commit | 79a2e690b4654e88437aa40627f24068dc5216f5 (patch) | |
tree | 7f3c0688b56f3b43464c3d6023a94fcb4c03812d /gcc/cp/decl.c | |
parent | 9a82bd058df19d15cfbd0c16a09a6ba0c5c5cfa7 (diff) | |
download | gcc-79a2e690b4654e88437aa40627f24068dc5216f5.zip gcc-79a2e690b4654e88437aa40627f24068dc5216f5.tar.gz gcc-79a2e690b4654e88437aa40627f24068dc5216f5.tar.bz2 |
class.c (finish_struct): Use OVL_P.
* class.c (finish_struct): Use OVL_P.
(get_vfield_name): Measure constructor_name length.
* cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
(NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
* cxx-pretty-print.c (is_destructor_name): Delete.
(pp_cxx_unqualified_id): Remove bogus destructor name checking.
* decl.c (grokfndecl): Move cheap checks first when looking for
implicit extern cness.
From-SVN: r249788
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 38c0348..c6b1f07 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8580,16 +8580,18 @@ grokfndecl (tree ctype, DECL_CONTEXT (decl) = FROB_CONTEXT (current_decl_namespace ()); /* `main' and builtins have implicit 'C' linkage. */ - if ((MAIN_NAME_P (declarator) - || (IDENTIFIER_LENGTH (declarator) > 10 - && IDENTIFIER_POINTER (declarator)[0] == '_' - && IDENTIFIER_POINTER (declarator)[1] == '_' - && strncmp (IDENTIFIER_POINTER (declarator)+2, "builtin_", 8) == 0) - || (targetcm.cxx_implicit_extern_c - && targetcm.cxx_implicit_extern_c(IDENTIFIER_POINTER (declarator)))) + if (ctype == NULL_TREE + && DECL_FILE_SCOPE_P (decl) && current_lang_name == lang_name_cplusplus - && ctype == NULL_TREE - && DECL_FILE_SCOPE_P (decl)) + && (MAIN_NAME_P (declarator) + || (IDENTIFIER_LENGTH (declarator) > 10 + && IDENTIFIER_POINTER (declarator)[0] == '_' + && IDENTIFIER_POINTER (declarator)[1] == '_' + && strncmp (IDENTIFIER_POINTER (declarator)+2, + "builtin_", 8) == 0) + || (targetcm.cxx_implicit_extern_c + && (targetcm.cxx_implicit_extern_c + (IDENTIFIER_POINTER (declarator)))))) SET_DECL_LANGUAGE (decl, lang_c); /* Should probably propagate const out from type to decl I bet (mrs). */ |