public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/55159] pythy constexpr auto lambda pointer has no initializer
Date: Fri, 02 Nov 2012 08:57:00 -0000	[thread overview]
Message-ID: <bug-55159-4-vmoCer0AQL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55159-4@http.gcc.gnu.org/bugzilla/>


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55159

--- Comment #5 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-11-02 08:57:33 UTC ---
I need to insert another correction. My attempt to simplify the reporters bug
failed because I was mislead by the report description that "visual studio 2012
work fine" interpreting this to mean the Microsoft Visual Studio 2012 compiler.
But that one does not understand 'constexpr' therefore my reduction to 'const'
was not equivalent.

(In reply to comment #1)
> I really think that Pythy should fix this implementation, because it is not
> supported by the C++11 standard. Any compiler accepting that is defect.

This statement still holds. The original code is not conforming.

The following presents a conforming code that reproduces the problem:

template <class T0, class T1>
struct min_t
{
    static bool less(T0 x, T1 y) { return x < y ? x : y; }
    constexpr static auto* f = &less; // #5
};

min_t<int, int> mi; // #8

"8|  required from here|
5|error: declaration of 'constexpr auto* const min_t<int, int>::f' has no
initializer"

Please ignore the part about const T in template deduction. This is a different
issue and not related to this one.


  parent reply	other threads:[~2012-11-02  8:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01  0:33 [Bug c++/55159] New: " supercilious.dude at gmail dot com
2012-11-01 10:58 ` [Bug c++/55159] " daniel.kruegler at googlemail dot com
2012-11-01 14:26 ` paolo.carlini at oracle dot com
2012-11-01 15:12 ` daniel.kruegler at googlemail dot com
2012-11-02  8:10 ` daniel.kruegler at googlemail dot com
2012-11-02  8:57 ` daniel.kruegler at googlemail dot com [this message]
2012-11-02 11:15 ` paolo.carlini at oracle dot com
2012-11-02 11:39 ` daniel.kruegler at googlemail dot com
2012-11-02 11:49 ` paolo.carlini at oracle dot com
2012-11-07 15:42 ` paolo.carlini at oracle dot com
2012-11-07 16:12 ` paolo.carlini at oracle dot com

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-55159-4-vmoCer0AQL@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: link
Be 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).