public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51501] New: decltype over-agressive SFINAE
@ 2011-12-10 21:06 dave at boostpro dot com
  2011-12-10 21:22 ` [Bug c++/51501] " dave at boostpro dot com
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: dave at boostpro dot com @ 2011-12-10 21:06 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51501
           Summary: decltype over-agressive SFINAE
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dave@boostpro.com


Please see attached, which fails to compile.  If you compile with -DWORKAROUND
you can "prove" to yourself that it ought to compile.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
@ 2011-12-10 21:22 ` dave at boostpro dot com
  2011-12-11 10:32 ` marc.glisse at normalesup dot org
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: dave at boostpro dot com @ 2011-12-10 21:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Dave Abrahams <dave at boostpro dot com> 2011-12-10 21:06:14 UTC ---
Created attachment 26045
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26045
test case

compile with -std=c++11 to see the failure.  Additionally add -DWORKAROUND to
demonstrate why it ought to work.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
  2011-12-10 21:22 ` [Bug c++/51501] " dave at boostpro dot com
@ 2011-12-11 10:32 ` marc.glisse at normalesup dot org
  2011-12-11 11:52 ` dave at boostpro dot com
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: marc.glisse at normalesup dot org @ 2011-12-11 10:32 UTC (permalink / raw)
  To: gcc-bugs

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

Marc Glisse <marc.glisse at normalesup dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marc.glisse at normalesup
                   |                            |dot org

--- Comment #2 from Marc Glisse <marc.glisse at normalesup dot org> 2011-12-11 09:41:00 UTC ---
Could this be related to Bug 45873?


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
  2011-12-10 21:22 ` [Bug c++/51501] " dave at boostpro dot com
  2011-12-11 10:32 ` marc.glisse at normalesup dot org
@ 2011-12-11 11:52 ` dave at boostpro dot com
  2011-12-19 22:07 ` jason at gcc dot gnu.org
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: dave at boostpro dot com @ 2011-12-11 11:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Dave Abrahams <dave at boostpro dot com> 2011-12-11 10:32:25 UTC ---
(In reply to comment #2)
> Could this be related to Bug 45873?

Not if your explanation in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45873#c2
is correct, I think.  This is a straightforward pack expansion with no change
in the number of arguments.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (2 preceding siblings ...)
  2011-12-11 11:52 ` dave at boostpro dot com
@ 2011-12-19 22:07 ` jason at gcc dot gnu.org
  2011-12-19 22:09 ` jason at gcc dot gnu.org
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2011-12-19 22:07 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011-12-19
                 CC|                            |jason at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-12-19 21:51:21 UTC ---
Reduced:

template <class T> T list(T x);

template <class H, class ...T>
auto list(H h, T ...args) -> decltype(list(args...));

auto list3 = list(1, 2, 3);


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (3 preceding siblings ...)
  2011-12-19 22:07 ` jason at gcc dot gnu.org
@ 2011-12-19 22:09 ` jason at gcc dot gnu.org
  2012-08-18 23:18 ` dave at boostpro dot com
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2011-12-19 22:09 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |SUSPENDED

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-12-19 22:06:03 UTC ---
The problem here is that the variadic 'list' is not in scope when the
trailing-return-type is parsed.  3.3.2 says,

The point of declaration for a name is immediately after its complete
declarator 

and the declarator includes the trailing-return-type.  And then since all the
arguments are integers, no argument-dependent lookup is done, so the call in
the trailing-return-type doesn't find the right template, and fails.

The versions of EDG and Clang that I have handy seem to reject this testcase on
the same basis.

This seems like a flaw in the standard.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (4 preceding siblings ...)
  2011-12-19 22:09 ` jason at gcc dot gnu.org
@ 2012-08-18 23:18 ` dave at boostpro dot com
  2012-12-15  4:08 ` jason at gcc dot gnu.org
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: dave at boostpro dot com @ 2012-08-18 23:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Dave Abrahams <dave at boostpro dot com> 2012-08-18 23:18:21 UTC ---
Jason, are you submitting (or is there already) an issue for this?


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (5 preceding siblings ...)
  2012-08-18 23:18 ` dave at boostpro dot com
@ 2012-12-15  4:08 ` jason at gcc dot gnu.org
  2014-05-07 20:20 ` [Bug c++/51501] [DR 1433] " redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-15  4:08 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2012-12-15 04:08:09 UTC ---
This is core issue 1433, classified as an extension in Kona.  I don't know if
EWG has taken a look at it yet.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] [DR 1433] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (6 preceding siblings ...)
  2012-12-15  4:08 ` jason at gcc dot gnu.org
@ 2014-05-07 20:20 ` redi at gcc dot gnu.org
  2014-05-08 13:55 ` jason at gcc dot gnu.org
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu.org @ 2014-05-07 20:20 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ville.voutilainen at gmail dot com

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
*** Bug 59481 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] [DR 1433] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (7 preceding siblings ...)
  2014-05-07 20:20 ` [Bug c++/51501] [DR 1433] " redi at gcc dot gnu.org
@ 2014-05-08 13:55 ` jason at gcc dot gnu.org
  2014-05-08 14:02 ` ville.voutilainen at gmail dot com
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-05-08 13:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> ---
Ville, has EWG taken a look at this issue?  I'm sorry this didn't come up in
the C++14 context, as it would have made sense to fix this when we were adding
deduced return types.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] [DR 1433] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (8 preceding siblings ...)
  2014-05-08 13:55 ` jason at gcc dot gnu.org
@ 2014-05-08 14:02 ` ville.voutilainen at gmail dot com
  2014-05-13 19:56 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ville.voutilainen at gmail dot com @ 2014-05-08 14:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
(In reply to Jason Merrill from comment #9)
> Ville, has EWG taken a look at this issue?  I'm sorry this didn't come up in

Not yet. The handling of Extension-status Core Issues was more or less
on hold while EWG was handling papers targeting C++14. I do intend to tell the
EWG chair that we need to speed up the handling of such issues, they are
already in the EWG issues list, this particular one is
http://cplusplus.github.io/EWG/ewg-index.html#104

Wording and/or implementation experience would certainly be very welcome. ;)


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] [DR 1433] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (9 preceding siblings ...)
  2014-05-08 14:02 ` ville.voutilainen at gmail dot com
@ 2014-05-13 19:56 ` redi at gcc dot gnu.org
  2014-10-09 10:01 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu.org @ 2014-05-13 19:56 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

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

--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
*** Bug 61178 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] [DR 1433] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (10 preceding siblings ...)
  2014-05-13 19:56 ` redi at gcc dot gnu.org
@ 2014-10-09 10:01 ` redi at gcc dot gnu.org
  2014-10-09 10:05 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu.org @ 2014-10-09 10:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #4)
> Reduced:
> 
> template <class T> T list(T x);
> 
> template <class H, class ...T>
> auto list(H h, T ...args) -> decltype(list(args...));
> 
> auto list3 = list(1, 2, 3);

Interestingly it works for (static or non-static) member functions:

struct X {
  template <class T> T list(T x);

  template <class H, class ...T>
  auto list(H h, T ...args) -> decltype(list(args...));
};

auto list3 = X{}.list(1, 2, 3);


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] [DR 1433] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (11 preceding siblings ...)
  2014-10-09 10:01 ` redi at gcc dot gnu.org
@ 2014-10-09 10:05 ` redi at gcc dot gnu.org
  2021-12-10  7:21 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu.org @ 2014-10-09 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Also I guess we can unsuspend this and close as INVALID now that EWG rejected
it.

And maybe issue a diagnostic for comment 12, as EDG and clang do?


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] [DR 1433] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (12 preceding siblings ...)
  2014-10-09 10:05 ` redi at gcc dot gnu.org
@ 2021-12-10  7:21 ` pinskia at gcc dot gnu.org
  2022-02-01 15:55 ` marxin at gcc dot gnu.org
  2022-02-01 22:48 ` jason at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-10  7:21 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |NEW
      Known to fail|                            |7.5.0
           Keywords|                            |accepts-invalid,
                   |                            |needs-bisection
      Known to work|                            |8.1.0

--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #13)
> And maybe issue a diagnostic for comment 12, as EDG and clang do?

We started to reject comment #12 in GCC 8+.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] [DR 1433] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (13 preceding siblings ...)
  2021-12-10  7:21 ` pinskia at gcc dot gnu.org
@ 2022-02-01 15:55 ` marxin at gcc dot gnu.org
  2022-02-01 22:48 ` jason at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-02-01 15:55 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needs-bisection             |
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #15 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #14)
> (In reply to Jonathan Wakely from comment #13)
> > And maybe issue a diagnostic for comment 12, as EDG and clang do?
> 
> We started to reject comment #12 in GCC 8+.

It's rejected since r8-5270-g2b031ef48e365e25.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug c++/51501] [DR 1433] decltype over-agressive SFINAE
  2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
                   ` (14 preceding siblings ...)
  2022-02-01 15:55 ` marxin at gcc dot gnu.org
@ 2022-02-01 22:48 ` jason at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2022-02-01 22:48 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |8.0

--- Comment #16 from Jason Merrill <jason at gcc dot gnu.org> ---
Then this seems resolved, until/unless someone actually proposes to make it
well-formed.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-02-01 22:48 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-10 21:06 [Bug c++/51501] New: decltype over-agressive SFINAE dave at boostpro dot com
2011-12-10 21:22 ` [Bug c++/51501] " dave at boostpro dot com
2011-12-11 10:32 ` marc.glisse at normalesup dot org
2011-12-11 11:52 ` dave at boostpro dot com
2011-12-19 22:07 ` jason at gcc dot gnu.org
2011-12-19 22:09 ` jason at gcc dot gnu.org
2012-08-18 23:18 ` dave at boostpro dot com
2012-12-15  4:08 ` jason at gcc dot gnu.org
2014-05-07 20:20 ` [Bug c++/51501] [DR 1433] " redi at gcc dot gnu.org
2014-05-08 13:55 ` jason at gcc dot gnu.org
2014-05-08 14:02 ` ville.voutilainen at gmail dot com
2014-05-13 19:56 ` redi at gcc dot gnu.org
2014-10-09 10:01 ` redi at gcc dot gnu.org
2014-10-09 10:05 ` redi at gcc dot gnu.org
2021-12-10  7:21 ` pinskia at gcc dot gnu.org
2022-02-01 15:55 ` marxin at gcc dot gnu.org
2022-02-01 22:48 ` 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).