diff options
author | Jason Merrill <jason@redhat.com> | 2015-03-27 12:36:32 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2015-03-27 12:36:32 -0400 |
commit | 0b7dccc63e31d11c2f129e569d06cef8c33d2921 (patch) | |
tree | 385edb202ce1e94c15a26c56e3122ef1bd64aef3 /gcc/cp/decl.c | |
parent | 6e85fbaadd3fdbc8127ec13b64fa70e59aef7665 (diff) | |
download | gcc-0b7dccc63e31d11c2f129e569d06cef8c33d2921.zip gcc-0b7dccc63e31d11c2f129e569d06cef8c33d2921.tar.gz gcc-0b7dccc63e31d11c2f129e569d06cef8c33d2921.tar.bz2 |
re PR c++/65509 ([C++11] GCC rejects operator== with two distinct pointers as not constexpr)
PR c++/65509
* decl.c (make_rtl_for_nonlocal_decl): Don't defer static
constants.
From-SVN: r221737
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index cb0f11f..f05aefa 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6061,7 +6061,6 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) { int toplev = toplevel_bindings_p (); int defer_p; - const char *filename; /* Set the DECL_ASSEMBLER_NAME for the object. */ if (asmspec) @@ -6109,32 +6108,9 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) DECL_EXPR is expanded. */ defer_p = DECL_FUNCTION_SCOPE_P (decl) || DECL_VIRTUAL_P (decl); - /* We try to defer namespace-scope static constants so that they are - not emitted into the object file unnecessarily. */ - filename = LOCATION_FILE (input_location); - if (!DECL_VIRTUAL_P (decl) - && TREE_READONLY (decl) - && DECL_INITIAL (decl) != NULL_TREE - && DECL_INITIAL (decl) != error_mark_node - && filename != NULL - && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl)) - && toplev - && !TREE_PUBLIC (decl)) - { - /* Fool with the linkage of static consts according to #pragma - interface. */ - struct c_fileinfo *finfo = get_fileinfo (filename); - if (!finfo->interface_unknown && !TREE_PUBLIC (decl)) - { - TREE_PUBLIC (decl) = 1; - DECL_EXTERNAL (decl) = finfo->interface_only; - } - - defer_p = 1; - } - /* Likewise for template instantiations. */ - else if (DECL_LANG_SPECIFIC (decl) - && DECL_IMPLICIT_INSTANTIATION (decl)) + /* Defer template instantiations. */ + if (DECL_LANG_SPECIFIC (decl) + && DECL_IMPLICIT_INSTANTIATION (decl)) defer_p = 1; /* If we're not deferring, go ahead and assemble the variable. */ |