public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "splinterofchaos at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/55993] [C++11] derived-to-base conversion fails in constant expression
Date: Thu, 26 Feb 2015 15:49:00 -0000	[thread overview]
Message-ID: <bug-55993-4-7Ss6WLniER@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55993-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55993

splinterofchaos at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |splinterofchaos at gmail dot com

--- Comment #11 from splinterofchaos at gmail dot com ---
I still get an error with 4.9 when using one of the less reduced cases,
although not when using the test cases in that patch.


#include <tuple>
struct A {};
constexpr auto t = std::get<0>( std::make_tuple( A(), A() ) );


$ g++ test.cpp -std=c++14 -Wall -Wextra; and ./a.out; echo $status
test.cpp:3:61:   in constexpr expansion of ‘std::get<0ul, {A, A}>((* &
std::make_tuple(_Elements&& ...) [with _Elements = {A, A}]((* & A()))))’
/usr/include/c++/4.9/tuple:774:44:   in constexpr expansion of ‘std::get<0ul,
{A, A}>((* & __t))’
/usr/include/c++/4.9/tuple:757:40:   in constexpr expansion of
‘std::__get_helper<0ul, A, {A}>((*(std::_Tuple_impl<0ul, A, A>*)(& __t)))’
/usr/include/c++/4.9/tuple:744:60:   in constexpr expansion of
‘std::_Tuple_impl<_Idx, _Head, _Tail ...>::_M_head<0ul, A, {A}>((* & __t))’
test.cpp:3:61: error: ‘(std::_Head_base<0ul, A, true>*)(& std::tuple<A, A>())’
is not a constant expression
 constexpr auto t = std::get<0>( std::make_tuple( A(), A() ) );


$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.1-16ubuntu6'
--with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.9 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify
--enable-plugin --with-system-zlib --disable-browser-plugin
--enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.1 (Ubuntu 4.9.1-16ubuntu6)
>From gcc-bugs-return-478603-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 26 14:55:55 2015
Return-Path: <gcc-bugs-return-478603-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 107945 invoked by alias); 26 Feb 2015 14:55:55 -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 107905 invoked by uid 48); 26 Feb 2015 14:55:51 -0000
From: "dcb314 at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/64570] error: non-trivial conversion at assignment
Date: Thu, 26 Feb 2015 15:54: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: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dcb314 at hotmail dot com
X-Bugzilla-Status: NEW
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:
Message-ID: <bug-64570-4-CUzGCB17rs@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64570-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64570-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: 2015-02/txt/msg02935.txt.bz2
Content-length: 323

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd570

--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Richard Biener from comment #2)
> Fails everywhere, 4.6 rejects the testcase.  Looks more like a C++ frontend
> issue to me.

Still goes wrong over a month later with trunk dated 20150225.


  parent reply	other threads:[~2015-02-26 14:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 16:53 [Bug libstdc++/55993] New: tuple_cat not a constant expression for result size >= 3 jnapoli at alum dot mit.edu
2013-01-15 17:26 ` [Bug libstdc++/55993] " redi at gcc dot gnu.org
2013-01-15 17:29 ` redi at gcc dot gnu.org
2013-01-15 18:44 ` jnapoli at alum dot mit.edu
2013-01-15 19:15 ` [Bug c++/55993] [C++11] derived-to-base conversion fails in constant expression redi at gcc dot gnu.org
2013-01-15 19:24 ` redi at gcc dot gnu.org
2013-01-15 19:27 ` jnapoli at alum dot mit.edu
2013-01-15 19:34 ` glisse at gcc dot gnu.org
2013-01-15 19:39 ` glisse at gcc dot gnu.org
2013-02-13 17:57 ` jason at gcc dot gnu.org
2013-02-15 19:28 ` jason at gcc dot gnu.org
2015-02-26 15:49 ` splinterofchaos at gmail dot com [this message]
2015-02-26 17:12 ` 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-55993-4-7Ss6WLniER@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).