public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49105] New: [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const
@ 2011-05-21 23:41 daniel.kruegler at googlemail dot com
2011-05-23 18:00 ` [Bug c++/49105] " jason at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2011-05-21 23:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49105
Summary: [C++0x][SFINAE] ICE during list-initialization of
rvalue-references to const
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: daniel.kruegler@googlemail.com
CC: jason@redhat.com
gcc 4.7.0 20110514 (experimental) in C++0x mode produces an internal compiler
error when compiling this code at the line marked with #:
//----
template<class T, class = decltype(T{})>
char f(int);
template<class T>
auto f(...) -> char(&)[2];
static_assert(sizeof(f<const int&&>(0)) == 1, "Error"); // #
//----
"internal compiler error: in cp_build_c_cast, at cp/typeck.c:6442|"
The code should be accepted.
Further tests provided evidence that we need an value-initialization of an
rvalue reference to const T to reproduce the ICE, even though the sole
initialization written as
const int&& rri{};
does not cause the same kind of problem. This is odd, because the functional
cast T{} has exactly the same semantics as the corresponding
direct-list-initialization.
Additionally, the same error occurs, when the list has one element, e.g. the
expression T{0} results in the same kind of error.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/49105] [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const
2011-05-21 23:41 [Bug c++/49105] New: [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const daniel.kruegler at googlemail dot com
@ 2011-05-23 18:00 ` jason at gcc dot gnu.org
2011-05-23 23:20 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-23 18:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49105
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011.05.23 17:38:40
CC| |jason at gcc dot gnu.org
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/49105] [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const
2011-05-21 23:41 [Bug c++/49105] New: [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const daniel.kruegler at googlemail dot com
2011-05-23 18:00 ` [Bug c++/49105] " jason at gcc dot gnu.org
@ 2011-05-23 23:20 ` jason at gcc dot gnu.org
2011-05-23 23:22 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-23 23:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49105
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-23 22:56:08 UTC ---
Author: jason
Date: Mon May 23 22:56:04 2011
New Revision: 174093
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174093
Log:
PR c++/49105
* typeck.c (cp_build_c_cast): Don't strip cv-quals when
converting to reference.
(build_static_cast_1): Update for glvalues.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/sfinae25.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/49105] [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const
2011-05-21 23:41 [Bug c++/49105] New: [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const daniel.kruegler at googlemail dot com
2011-05-23 18:00 ` [Bug c++/49105] " jason at gcc dot gnu.org
2011-05-23 23:20 ` jason at gcc dot gnu.org
@ 2011-05-23 23:22 ` jason at gcc dot gnu.org
2011-05-25 1:38 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-23 23:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49105
--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-23 22:56:00 UTC ---
Author: jason
Date: Mon May 23 22:55:56 2011
New Revision: 174092
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174092
Log:
PR c++/49105
* typeck.c (build_const_cast_1): Handle rvalue references.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/rv-cast2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/49105] [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const
2011-05-21 23:41 [Bug c++/49105] New: [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const daniel.kruegler at googlemail dot com
` (2 preceding siblings ...)
2011-05-23 23:22 ` jason at gcc dot gnu.org
@ 2011-05-25 1:38 ` jason at gcc dot gnu.org
2011-05-25 2:10 ` jason at gcc dot gnu.org
2011-05-29 1:17 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-25 1:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49105
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-25 01:08:42 UTC ---
Author: jason
Date: Wed May 25 01:08:38 2011
New Revision: 174162
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174162
Log:
PR c++/49105
* typeck.c (build_const_cast_1): Handle rvalue references.
Added:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/rv-cast2.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/typeck.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/49105] [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const
2011-05-21 23:41 [Bug c++/49105] New: [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const daniel.kruegler at googlemail dot com
` (3 preceding siblings ...)
2011-05-25 1:38 ` jason at gcc dot gnu.org
@ 2011-05-25 2:10 ` jason at gcc dot gnu.org
2011-05-29 1:17 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-25 2:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49105
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.6.1
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-25 01:13:46 UTC ---
Fixed for 4.6.1.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/49105] [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const
2011-05-21 23:41 [Bug c++/49105] New: [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const daniel.kruegler at googlemail dot com
` (4 preceding siblings ...)
2011-05-25 2:10 ` jason at gcc dot gnu.org
@ 2011-05-29 1:17 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-29 1:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49105
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wsf at fultondesigns dot
| |co.uk
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-29 00:45:29 UTC ---
*** Bug 44920 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-29 0:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-21 23:41 [Bug c++/49105] New: [C++0x][SFINAE] ICE during list-initialization of rvalue-references to const daniel.kruegler at googlemail dot com
2011-05-23 18:00 ` [Bug c++/49105] " jason at gcc dot gnu.org
2011-05-23 23:20 ` jason at gcc dot gnu.org
2011-05-23 23:22 ` jason at gcc dot gnu.org
2011-05-25 1:38 ` jason at gcc dot gnu.org
2011-05-25 2:10 ` jason at gcc dot gnu.org
2011-05-29 1:17 ` jason at gcc dot gnu.org
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).