public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/52282] [C++0x] ICE / confused by earlier errors with decltype/constexpr Date: Mon, 07 May 2012 10:07:00 -0000 [thread overview] Message-ID: <bug-52282-4-5t1XavgP7f@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-52282-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52282 Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2012-05-07 CC| |paolo.carlini at oracle dot | |com Ever Confirmed|0 |1 --- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-05-07 09:50:43 UTC --- For concreteness, with the below patchlet (for the record, about the cxx_eval_call_expression bits, in build_data_member_initialization we have something quite similar) all the test pass, besides the four lines: static_assert((c.*W_<int(C::*)()const, &C::c1>::value)() == 10, "oops"); static_assert((c.*X_<int(C::*)()const, &C::c1>::value)() == 10, "oops"); static_assert((c.*Y_<int(C::*)()const, &C::c1>::value)() == 10, "oops"); static_assert((c.*Z_<int(C::*)()const, &C::c1>::value)() == 10, "oops"); /////////////// Index: semantics.c =================================================================== --- semantics.c (revision 187228) +++ semantics.c (working copy) @@ -5269,6 +5269,7 @@ finish_decltype_type (tree expr, bool id_expressio case INTEGER_CST: case PTRMEM_CST: + case ADDR_EXPR: /* We can get here when the id-expression refers to an enumerator or non-type template parameter. */ type = TREE_TYPE (expr); @@ -6488,6 +6489,12 @@ cxx_eval_call_expression (const constexpr_call *ol /* Might be a constexpr function pointer. */ fun = cxx_eval_constant_expression (old_call, fun, allow_non_constant, /*addr*/false, non_constant_p); + if (TREE_CODE (fun) == NOP_EXPR) + { + tree tmp = fun; + STRIP_NOPS (tmp); + fun = tmp; + } if (TREE_CODE (fun) == ADDR_EXPR) fun = TREE_OPERAND (fun, 0); }
next prev parent reply other threads:[~2012-05-07 9:51 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-02-16 15:56 [Bug c++/52282] New: " andyg1001 at hotmail dot co.uk 2012-02-16 19:41 ` [Bug c++/52282] " daniel.kruegler at googlemail dot com 2012-02-24 18:33 ` andyg1001 at hotmail dot co.uk 2012-05-04 16:22 ` andyg1001 at hotmail dot co.uk 2012-05-04 16:43 ` daniel.kruegler at googlemail dot com 2012-05-04 18:41 ` paolo.carlini at oracle dot com 2012-05-07 10:07 ` paolo.carlini at oracle dot com [this message] 2013-05-01 11:48 ` paolo.carlini at oracle dot com 2014-11-17 17:01 ` [Bug c++/52282] [C++0x] rejects-valid issues " jason at gcc dot gnu.org 2014-11-17 19:19 ` jason at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-52282-4-5t1XavgP7f@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).