From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21856 invoked by alias); 7 Apr 2015 17:19:23 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 21823 invoked by uid 48); 7 Apr 2015 17:19:19 -0000 From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65642] [C++11] GCC rejects valid constant expression Date: Tue, 07 Apr 2015 17:19:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to target_milestone Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg00445.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65642 Marek Polacek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW Assignee|mpolacek at gcc dot gnu.org |unassigned at gcc dot gnu.org Target Milestone|5.0 |6.0 --- Comment #6 from Marek Polacek --- I think that fixing the third case is going to be harder, and doesn't look like something that should be fixed in cp/constexpr.c. While fold_comparison is able to fold the NE_EXPR here: constexpr char s1[] = "s1"; constexpr char s2[] = "s2"; constexpr auto eq = (s2 + 2) != (s2 + 1); it isn't able to fold it here: constexpr char s1[] = "s1"; constexpr char s2[] = "s2"; constexpr auto eq = (s1 + 2) != (s2 + 1); So not sure what to do here, but in any case, I think it is a GCC 6 material.