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++/57248] string parameter to constexpr functions
Date: Thu, 23 May 2013 21:23:00 -0000	[thread overview]
Message-ID: <bug-57248-4-ljEUnTll8a@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57248-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The code looks valid to me. I think that Paolo just wanted to point out that
the library implementation does not cause this. I agree with him and can
confirm that the code is also rejected when emulating the library such as in
the following way:

template<bool, class>
struct enable_if{};

template<class T>
struct enable_if<true, T>{ typedef T type; };

template<class T1, class T2>
struct tuple
{
  T1 t1;
  T2 t2;
};

template<unsigned I, class T1, class T2>
constexpr
typename enable_if<I == 0, T1>::type
get(tuple<T1, T2> t) { return t.t1; }

template<unsigned I, class T1, class T2>
constexpr
typename enable_if<I == 1, T1>::type
get(tuple<T1, T2> t) { return t.t2; }

template<class T1, class T2>
constexpr tuple<T1, T2> make_tuple(T1 t1, T2 t2)
{
  return tuple<T1, T2>{t1, t2};
}

Same error here.
>From gcc-bugs-return-422995-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu May 23 21:34:47 2013
Return-Path: <gcc-bugs-return-422995-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19574 invoked by alias); 23 May 2013 21:34:47 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19511 invoked by uid 48); 23 May 2013 21:34:41 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/57359] wrong code for union access at -O3 on x86_64-linux
Date: Thu, 23 May 2013 21:34:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-57359-4-u4neS71Qb1@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57359-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57359-4@http.gcc.gnu.org/bugzilla/>
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: 2013-05/txt/msg01668.txt.bz2
Content-length: 448

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW359

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
NP, and thanks a lot for the bugreports, they are very much appreciated.


  parent reply	other threads:[~2013-05-23 21:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-10 23:26 [Bug c++/57248] New: " sutambe at yahoo dot com
2013-05-11  0:21 ` [Bug c++/57248] " paolo.carlini at oracle dot com
2013-05-23 19:07 ` sutambe at yahoo dot com
2013-05-23 21:23 ` daniel.kruegler at googlemail dot com [this message]
2013-05-23 22:44 ` paolo.carlini at oracle dot com
2014-09-05 10:51 ` paolo.carlini at oracle dot com
2014-09-05 11:02 ` paolo.carlini at oracle dot com
2014-10-02 20:40 ` daniel.kruegler at googlemail dot com
2014-10-03 20:41 ` sutambe at yahoo dot com
2014-10-03 20:47 ` daniel.kruegler at googlemail dot com
2014-10-22  9:30 ` 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-57248-4-ljEUnTll8a@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).