public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65750] New: miss interpret in a virtual member function with a C++11 style function signature
@ 2015-04-13  2:54 usagi at WonderRabbitProject dot net
  2015-04-13  9:21 ` [Bug c++/65750] [4.9/5 Regression] misinterpret " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: usagi at WonderRabbitProject dot net @ 2015-04-13  2:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65750
           Summary: miss interpret in a virtual member function with a
                    C++11 style function signature
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: usagi at WonderRabbitProject dot net

Repro:

#include <functional>

class a
{
  virtual auto f( std::function< void () > ) -> void;
  virtual auto g( std::function< auto () -> void > ) -> void;
};

auto main() -> int { }


Result 1 ( g++-5.0.0, 4.9.2 and >= 4.9.0 ):

prog.cc:6:16: error: implicit templates may not be 'virtual'
   virtual auto g( std::function< auto () -> void > ) -> void;

Result 2 ( g++-4.8.2, g++4.7.3 ):

(no errors, compile is succeed.)

Result 3 ( clang++-3.7.0, 3.6.0, 3.5.0 and 3.4 )

(no errors, compile is succeed.)


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

* [Bug c++/65750] [4.9/5 Regression] misinterpret in a virtual member function with a C++11 style function signature
  2015-04-13  2:54 [Bug c++/65750] New: miss interpret in a virtual member function with a C++11 style function signature usagi at WonderRabbitProject dot net
@ 2015-04-13  9:21 ` redi at gcc dot gnu.org
  2015-04-13 20:58 ` jason at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2015-04-13  9:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-04-13
      Known to work|                            |4.8.3
            Summary|miss interpret in a virtual |[4.9/5 Regression]
                   |member function with a      |misinterpret in a virtual
                   |C++11 style function        |member function with a
                   |signature                   |C++11 style function
                   |                            |signature
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Rejects-valid, introduced by support for C++14 return type deduction.


Reduced:

template<typename T> struct F { };

class a
{
  virtual auto f( F< void () > ) -> void;
  virtual auto g( F< auto () -> void > ) -> void;
};

auto main() -> int { }



The error in comment 0 is only on the 4.9 branch, 5.0 gives a different error:

s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with
-std=c++14 or -std=gnu++14
   virtual auto g( F< auto () -> void > ) -> void;
                      ^
s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with
-std=c++14 or -std=gnu++14
s.cc:6:38: error: template argument 1 is invalid
   virtual auto g( F< auto () -> void > ) -> void;
                                      ^
s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with
-std=c++14 or -std=gnu++14
   virtual auto g( F< auto () -> void > ) -> void;
                      ^
s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with
-std=c++14 or -std=gnu++14
s.cc:6:38: error: template argument 1 is invalid
   virtual auto g( F< auto () -> void > ) -> void;
                                      ^
s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with
-std=c++14 or -std=gnu++14
   virtual auto g( F< auto () -> void > ) -> void;
                      ^
s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with
-std=c++14 or -std=gnu++14
s.cc:6:38: error: template argument 1 is invalid
   virtual auto g( F< auto () -> void > ) -> void;
                                      ^
s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with
-std=c++14 or -std=gnu++14
   virtual auto g( F< auto () -> void > ) -> void;
                      ^
s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with
-std=c++14 or -std=gnu++14
s.cc:6:38: error: template argument 1 is invalid
   virtual auto g( F< auto () -> void > ) -> void;
                                      ^
s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with
-std=c++14 or -std=gnu++14
   virtual auto g( F< auto () -> void > ) -> void;
                      ^
s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with
-std=c++14 or -std=gnu++14
s.cc:6:38: error: template argument 1 is invalid
   virtual auto g( F< auto () -> void > ) -> void;
                                      ^
s.cc:6:19: error: ‘F’ is not a type
   virtual auto g( F< auto () -> void > ) -> void;
                   ^
s.cc:6:20: error: expected ‘,’ or ‘...’ before ‘<’ token
   virtual auto g( F< auto () -> void > ) -> void;
                    ^
>From gcc-bugs-return-483471-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Apr 13 09:44:04 2015
Return-Path: <gcc-bugs-return-483471-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14304 invoked by alias); 13 Apr 2015 09:44:03 -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 14230 invoked by uid 48); 13 Apr 2015 09:44:00 -0000
From: "prathamesh3492 at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/49551] tentative declaration after definition and -fdata-sections cause ICE in C front-end.
Date: Mon, 13 Apr 2015 09:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: prathamesh3492 at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: prathamesh3492 at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc everconfirmed
Message-ID: <bug-49551-4-GFZsHTi4UC@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-49551-4@http.gcc.gnu.org/bugzilla/>
References: <bug-49551-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-04/txt/msg01023.txt.bz2
Content-length: 755

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

prathamesh3492 at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|2015-03-23 00:00:00         |2015-04-13
                 CC|                            |charles.baylis at linaro dot org,
                   |                            |mkuvyrkov at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #4 from prathamesh3492 at gcc dot gnu.org ---
Hi,
The ICE is not reproducible on the trunk any more. git bisect shows
it became non-reproducible after r221297.

Thank you,
Prathamesh


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

* [Bug c++/65750] [4.9/5 Regression] misinterpret in a virtual member function with a C++11 style function signature
  2015-04-13  2:54 [Bug c++/65750] New: miss interpret in a virtual member function with a C++11 style function signature usagi at WonderRabbitProject dot net
  2015-04-13  9:21 ` [Bug c++/65750] [4.9/5 Regression] misinterpret " redi at gcc dot gnu.org
@ 2015-04-13 20:58 ` jason at gcc dot gnu.org
  2015-04-13 21:20 ` abutcher at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-04-13 20:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |abutcher at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
I think this is from the generic lambda/implicit template work rather than
return type deduction.


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

* [Bug c++/65750] [4.9/5 Regression] misinterpret in a virtual member function with a C++11 style function signature
  2015-04-13  2:54 [Bug c++/65750] New: miss interpret in a virtual member function with a C++11 style function signature usagi at WonderRabbitProject dot net
  2015-04-13  9:21 ` [Bug c++/65750] [4.9/5 Regression] misinterpret " redi at gcc dot gnu.org
  2015-04-13 20:58 ` jason at gcc dot gnu.org
@ 2015-04-13 21:20 ` abutcher at gcc dot gnu.org
  2015-04-14  9:17 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: abutcher at gcc dot gnu.org @ 2015-04-13 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Adam Butcher <abutcher at gcc dot gnu.org> ---
Agreed.  Upon seeing the 'auto' in the parameter list, we'll synthesize a
template parameter for 'g'.  I think Paolo added the diagnostic for virtual to
fix an ICE.

I'm not sure immediately how to handle this one.  For function pointer types
"auto (" should have this behavior.  Maybe we need a bit of look-ahead to solve
this (either for a function pointer or the trailing return arrow).

Looks like trying to tie down semantics at parse time is biting us again.


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

* [Bug c++/65750] [4.9/5 Regression] misinterpret in a virtual member function with a C++11 style function signature
  2015-04-13  2:54 [Bug c++/65750] New: miss interpret in a virtual member function with a C++11 style function signature usagi at WonderRabbitProject dot net
                   ` (2 preceding siblings ...)
  2015-04-13 21:20 ` abutcher at gcc dot gnu.org
@ 2015-04-14  9:17 ` jakub at gcc dot gnu.org
  2015-05-22 15:29 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-14  9:17 UTC (permalink / raw)
  To: gcc-bugs

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

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> ---
It started to be rejected with r204714, and since r218879 there are lost of
errors instead of just one warning and one error.


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

* [Bug c++/65750] [4.9/5 Regression] misinterpret in a virtual member function with a C++11 style function signature
  2015-04-13  2:54 [Bug c++/65750] New: miss interpret in a virtual member function with a C++11 style function signature usagi at WonderRabbitProject dot net
                   ` (3 preceding siblings ...)
  2015-04-14  9:17 ` jakub at gcc dot gnu.org
@ 2015-05-22 15:29 ` paolo.carlini at oracle dot com
  2015-06-24 15:13 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-05-22 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paolo.carlini at oracle dot com

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Out of curiosity, what happened to the work linked in Comment #5? I see an Ok
and then nothing more?


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

* [Bug c++/65750] [4.9/5 Regression] misinterpret in a virtual member function with a C++11 style function signature
  2015-04-13  2:54 [Bug c++/65750] New: miss interpret in a virtual member function with a C++11 style function signature usagi at WonderRabbitProject dot net
                   ` (4 preceding siblings ...)
  2015-05-22 15:29 ` paolo.carlini at oracle dot com
@ 2015-06-24 15:13 ` paolo.carlini at oracle dot com
  2015-06-29  9:35 ` paolo at gcc dot gnu.org
  2015-06-29  9:36 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-06-24 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed in trunk so far.


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

* [Bug c++/65750] [4.9/5 Regression] misinterpret in a virtual member function with a C++11 style function signature
  2015-04-13  2:54 [Bug c++/65750] New: miss interpret in a virtual member function with a C++11 style function signature usagi at WonderRabbitProject dot net
                   ` (5 preceding siblings ...)
  2015-06-24 15:13 ` paolo.carlini at oracle dot com
@ 2015-06-29  9:35 ` paolo at gcc dot gnu.org
  2015-06-29  9:36 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-06-29  9:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Mon Jun 29 09:34:58 2015
New Revision: 225114

URL: https://gcc.gnu.org/viewcvs?rev=225114&root=gcc&view=rev
Log:
/cp
2015-06-29  Adam Butcher  <adam@jessamine.co.uk>

        PR c++/65750
        * parser.c (cp_parser_simple_type_specifier): Don't synthesize
        implicit template parm if 'auto' is a placeholder for trailing
        return type.

/testsuite
2015-06-29  Adam Butcher  <adam@jessamine.co.uk>

        PR c++/65750
        * g++.dg/cpp0x/trailing11.C: New.

Added:
    branches/gcc-5-branch/gcc/testsuite/g++.dg/cpp0x/trailing11.C
Modified:
    branches/gcc-5-branch/gcc/cp/ChangeLog
    branches/gcc-5-branch/gcc/cp/parser.c
    branches/gcc-5-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/65750] [4.9/5 Regression] misinterpret in a virtual member function with a C++11 style function signature
  2015-04-13  2:54 [Bug c++/65750] New: miss interpret in a virtual member function with a C++11 style function signature usagi at WonderRabbitProject dot net
                   ` (6 preceding siblings ...)
  2015-06-29  9:35 ` paolo at gcc dot gnu.org
@ 2015-06-29  9:36 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-06-29  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

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

--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 5.2 too.


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

end of thread, other threads:[~2015-06-29  9:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-13  2:54 [Bug c++/65750] New: miss interpret in a virtual member function with a C++11 style function signature usagi at WonderRabbitProject dot net
2015-04-13  9:21 ` [Bug c++/65750] [4.9/5 Regression] misinterpret " redi at gcc dot gnu.org
2015-04-13 20:58 ` jason at gcc dot gnu.org
2015-04-13 21:20 ` abutcher at gcc dot gnu.org
2015-04-14  9:17 ` jakub at gcc dot gnu.org
2015-05-22 15:29 ` paolo.carlini at oracle dot com
2015-06-24 15:13 ` paolo.carlini at oracle dot com
2015-06-29  9:35 ` paolo at gcc dot gnu.org
2015-06-29  9:36 ` paolo.carlini at oracle dot com

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).