public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48647] New: [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator
@ 2011-04-17 7:49 gintensubaru at gmail dot com
2011-04-17 21:50 ` [Bug c++/48647] " paolo.carlini at oracle dot com
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: gintensubaru at gmail dot com @ 2011-04-17 7:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48647
Summary: [C++0x] SFINAE does not handle incompatible pointer
types well in conditional operator
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: gintensubaru@gmail.com
template< class T >
T&& declval();
template< class T, class U >
decltype( true ? declval<T>() : declval<U>() ) test( int );
template< class T, class U >
void test( ... );
template< class T, class U >
struct is_same {
static const bool value = false;
};
template< class T >
struct is_same<T, T> {
static const bool value = true;
};
int main()
{
typedef decltype( test<int*, double*>(0) ) void_expected;
static_assert( is_same<void_expected, void>::value, "This should be true,
and" );
static_assert( is_same<void_expected, void*>::value, "this should be false."
);
}
-------------------
In this code, type of expression 'test<int*, double*>(0)' should be void,
but gcc (-std=c++0x) says it's void*, on all of following versions:
4.5.1
4.6.0
4.6.1-20110415
4.7.0-20110416
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/48647] [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator
2011-04-17 7:49 [Bug c++/48647] New: [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator gintensubaru at gmail dot com
@ 2011-04-17 21:50 ` paolo.carlini at oracle dot com
2011-05-22 19:14 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-04-17 21:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48647
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-04-17 21:49:18 UTC ---
Likewise...
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/48647] [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator
2011-04-17 7:49 [Bug c++/48647] New: [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator gintensubaru at gmail dot com
2011-04-17 21:50 ` [Bug c++/48647] " paolo.carlini at oracle dot com
@ 2011-05-22 19:14 ` jason at gcc dot gnu.org
2011-05-22 19:21 ` 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-22 19:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48647
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011.05.22 18:57:58
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++/48647] [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator
2011-04-17 7:49 [Bug c++/48647] New: [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator gintensubaru at gmail dot com
2011-04-17 21:50 ` [Bug c++/48647] " paolo.carlini at oracle dot com
2011-05-22 19:14 ` jason at gcc dot gnu.org
@ 2011-05-22 19:21 ` jason at gcc dot gnu.org
2011-05-22 19:23 ` 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-22 19:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48647
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-22 18:59:30 UTC ---
*** Bug 48646 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/48647] [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator
2011-04-17 7:49 [Bug c++/48647] New: [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator gintensubaru at gmail dot com
` (2 preceding siblings ...)
2011-05-22 19:21 ` jason at gcc dot gnu.org
@ 2011-05-22 19:23 ` jason at gcc dot gnu.org
2011-05-22 21:09 ` jason at gcc dot gnu.org
2011-05-25 1:56 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-22 19:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48647
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-22 18:48:42 UTC ---
Author: jason
Date: Sun May 22 18:48:39 2011
New Revision: 174031
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174031
Log:
PR c++/48647
* typeck.c (composite_pointer_type_r): Return error_mark_node
on error in SFINAE context.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/sfinae23.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/template/sfinae8.C
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/48647] [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator
2011-04-17 7:49 [Bug c++/48647] New: [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator gintensubaru at gmail dot com
` (3 preceding siblings ...)
2011-05-22 19:23 ` jason at gcc dot gnu.org
@ 2011-05-22 21:09 ` jason at gcc dot gnu.org
2011-05-25 1:56 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-22 21:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48647
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-22 20:32:03 UTC ---
Author: jason
Date: Sun May 22 20:31:59 2011
New Revision: 174044
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174044
Log:
PR c++/48647
* typeck.c (composite_pointer_type_r): Return error_mark_node
on error in SFINAE context.
Added:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/sfinae23.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
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/template/sfinae8.C
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/48647] [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator
2011-04-17 7:49 [Bug c++/48647] New: [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator gintensubaru at gmail dot com
` (4 preceding siblings ...)
2011-05-22 21:09 ` jason at gcc dot gnu.org
@ 2011-05-25 1:56 ` 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:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48647
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.6.1
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-25 01:19:50 UTC ---
Fixed for 4.6.1.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-25 1:54 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-17 7:49 [Bug c++/48647] New: [C++0x] SFINAE does not handle incompatible pointer types well in conditional operator gintensubaru at gmail dot com
2011-04-17 21:50 ` [Bug c++/48647] " paolo.carlini at oracle dot com
2011-05-22 19:14 ` jason at gcc dot gnu.org
2011-05-22 19:21 ` jason at gcc dot gnu.org
2011-05-22 19:23 ` jason at gcc dot gnu.org
2011-05-22 21:09 ` jason at gcc dot gnu.org
2011-05-25 1:56 ` 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).