This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/65509] [5 Regression] [C++11] GCC rejects operator== with two distinct pointers as not constexpr
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 Mar 2015 14:40:30 +0000
- Subject: [Bug c++/65509] [5 Regression] [C++11] GCC rejects operator== with two distinct pointers as not constexpr
- Auto-submitted: auto-generated
- References: <bug-65509-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65509
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #8)
> The following (untested) should work:
>
> --- a/gcc/cp/decl.c
> +++ b/gcc/cp/decl.c
> @@ -6113,6 +6113,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init,
> const char* asmspec)
> not emitted into the object file unnecessarily. */
> filename = LOCATION_FILE (input_location);
> if (!DECL_VIRTUAL_P (decl)
> + && !DECL_DECLARED_CONSTEXPR_P (decl)
> && TREE_READONLY (decl)
> && DECL_INITIAL (decl) != NULL_TREE
> && DECL_INITIAL (decl) != error_mark_node
>
> My reasoning is that we shouldn't defer assembling the variable if it might
> be needed in the constexpr context.
But in the #c5 testcase it isn't DECL_DECLARED_CONSTEXPR_P, is it?