public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61753] New: [4.7.2 regression] prototype for function does not match any in class error
@ 2014-07-08 17:24 shapero at uw dot edu
  2014-07-08 17:46 ` [Bug c++/61753] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: shapero at uw dot edu @ 2014-07-08 17:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61753
           Summary: [4.7.2 regression] prototype for function does not
                    match any in class error
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shapero at uw dot edu

I'm trying to compile the Pegmatite library:

https://github.com/CompilerTeaching/Pegmatite

The commit I'm working off of is f5a941ebad149470fa633ba4fdbae318b1e66782. The
library compiles and runs fine with the most recent version of clang and with
g++ 4.6.3, on Linux Mint 14.

However, using g++ 4.7.2, I get the following error message:

/home/daniel/programs/Pegmatite/parser.cc:1330:7: error: prototype for
‘pegmatite::Rule::Rule(pegmatite::ExprPtr)’ does not match any in class
‘pegmatite::Rule’
In file included from /home/daniel/programs/Pegmatite/parser.cc:38:0:
/home/daniel/programs/Pegmatite/parser.hh:486:2: error: candidates are:
pegmatite::Rule::Rule(pegmatite::ExprPtr)
/home/daniel/programs/Pegmatite/parser.hh:481:2: error:                
pegmatite::Rule::Rule(const pegmatite::Rule&&)
/home/daniel/programs/Pegmatite/parser.hh:476:2: error:                
pegmatite::Rule::Rule(const pegmatite::Rule&)
/home/daniel/programs/Pegmatite/parser.hh:472:2: error:                
pegmatite::Rule::Rule(pegmatite::CharacterExprPtr)

The error says that the constructor

pegmatite::Rule::Rule(pegmative::ExprPtr)

has no match in the class pegmatite::Rule, and yet the very first candidate it
lists is just that.
>From gcc-bugs-return-455900-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jul 08 17:26:12 2014
Return-Path: <gcc-bugs-return-455900-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24270 invoked by alias); 8 Jul 2014 17:26:10 -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 24166 invoked by uid 48); 8 Jul 2014 17:26:03 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/61753] [4.7.2 regression] prototype for function does not match any in class error
Date: Tue, 08 Jul 2014 17:26: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: 4.7.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: WAITING
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: bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-61753-4-K9MbP2y633@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61753-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61753-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: 2014-07/txt/msg00491.txt.bz2
Content-length: 540

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-07-08
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Please provide the information requested at http://gcc.gnu.org/bugs


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

* [Bug c++/61753] [4.7.2 regression] prototype for function does not match any in class error
  2014-07-08 17:24 [Bug c++/61753] New: [4.7.2 regression] prototype for function does not match any in class error shapero at uw dot edu
@ 2014-07-08 17:46 ` redi at gcc dot gnu.org
  2014-07-08 17:59 ` [Bug c++/61753] poor diagnostic for constructor definition that starts with 'const' redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2014-07-08 17:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|WAITING                     |NEW

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is not valid syntax for a constructor:

const Rule::Rule(const ExprPtr e) :
    expr(e)
{
}

The first const is ill-formed (and the second one is pointless, but harmless)

The error message could be better though, reduced:

class Rule {
  Rule(int e);
};

const Rule::Rule(int e) { }


test.cc:5:7: error: prototype for ‘Rule::Rule(int)’ does not match any in class
‘Rule’
 const Rule::Rule(int e) { }
       ^
test.cc:1:7: error: candidates are: Rule::Rule(const Rule&)
 class Rule {
       ^
test.cc:2:3: error:                 Rule::Rule(int)
   Rule(int e);
   ^


EDG has a better diagnostic:

"test.cc", line 5: error: return type may not be specified on a constructor
>From gcc-bugs-return-455905-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jul 08 17:51:15 2014
Return-Path: <gcc-bugs-return-455905-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 26770 invoked by alias); 8 Jul 2014 17:51:14 -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 26104 invoked by uid 48); 8 Jul 2014 17:50:53 -0000
From: "dje at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug go/61746] A line starting with /*// causes an error even if the /* is closed on the next line
Date: Tue, 08 Jul 2014 17:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: go
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dje at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ian at airs dot com
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc everconfirmed
Message-ID: <bug-61746-4-M6XVq8MYzw@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61746-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61746-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: 2014-07/txt/msg00496.txt.bz2
Content-length: 544

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

David Edelsohn <dje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-07-08
                 CC|                            |ian at airs dot com
     Ever confirmed|0                           |1

--- Comment #1 from David Edelsohn <dje at gcc dot gnu.org> ---
Confirmed.


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

* [Bug c++/61753] poor diagnostic for constructor definition that starts with 'const'
  2014-07-08 17:24 [Bug c++/61753] New: [4.7.2 regression] prototype for function does not match any in class error shapero at uw dot edu
  2014-07-08 17:46 ` [Bug c++/61753] " redi at gcc dot gnu.org
@ 2014-07-08 17:59 ` redi at gcc dot gnu.org
  2014-07-09  0:36 ` shapero at uw dot edu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2014-07-08 17:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.7.2 regression]          |poor diagnostic for
                   |prototype for function does |constructor definition that
                   |not match any in class      |starts with 'const'
                   |error                       |

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I don't know how you got that to compile with GCC 4.6.3 as every version I have
rejects it - not a regression.

(The upstream code on github has been fixed now btw)


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

* [Bug c++/61753] poor diagnostic for constructor definition that starts with 'const'
  2014-07-08 17:24 [Bug c++/61753] New: [4.7.2 regression] prototype for function does not match any in class error shapero at uw dot edu
  2014-07-08 17:46 ` [Bug c++/61753] " redi at gcc dot gnu.org
  2014-07-08 17:59 ` [Bug c++/61753] poor diagnostic for constructor definition that starts with 'const' redi at gcc dot gnu.org
@ 2014-07-09  0:36 ` shapero at uw dot edu
  2015-08-31 15:44 ` paolo.carlini at oracle dot com
  2015-09-01  8:40 ` paolo at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: shapero at uw dot edu @ 2014-07-09  0:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from shapero at uw dot edu ---
(In reply to Jonathan Wakely from comment #3)
> I don't know how you got that to compile with GCC 4.6.3 as every version I
> have rejects it - not a regression.
> 
> (The upstream code on github has been fixed now btw)

Thanks for getting to this so quickly! My C++ is spotty, so I didn't recognize
that the syntax was invalid. I figured the fact that it compiled on clang meant
that it was a problem with GCC and not the code itself.


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

* [Bug c++/61753] poor diagnostic for constructor definition that starts with 'const'
  2014-07-08 17:24 [Bug c++/61753] New: [4.7.2 regression] prototype for function does not match any in class error shapero at uw dot edu
                   ` (2 preceding siblings ...)
  2014-07-09  0:36 ` shapero at uw dot edu
@ 2015-08-31 15:44 ` paolo.carlini at oracle dot com
  2015-09-01  8:40 ` paolo at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-08-31 15:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com


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

* [Bug c++/61753] poor diagnostic for constructor definition that starts with 'const'
  2014-07-08 17:24 [Bug c++/61753] New: [4.7.2 regression] prototype for function does not match any in class error shapero at uw dot edu
                   ` (3 preceding siblings ...)
  2015-08-31 15:44 ` paolo.carlini at oracle dot com
@ 2015-09-01  8:40 ` paolo at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-09-01  8:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Tue Sep  1 08:39:47 2015
New Revision: 227361

URL: https://gcc.gnu.org/viewcvs?rev=227361&root=gcc&view=rev
Log:
/cp
2015-09-01  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/61753
        * decl.c (smallest_type_quals_location): New.
        (check_special_function_return_type): Use the latter; add int and
        const location_t* parameters.
        (grokdeclarator): Adjust check_special_function_return_type call.

/testsuite
2015-09-01  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/61753
        * g++.dg/other/pr61753.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/other/pr61753.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2015-09-01  8:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08 17:24 [Bug c++/61753] New: [4.7.2 regression] prototype for function does not match any in class error shapero at uw dot edu
2014-07-08 17:46 ` [Bug c++/61753] " redi at gcc dot gnu.org
2014-07-08 17:59 ` [Bug c++/61753] poor diagnostic for constructor definition that starts with 'const' redi at gcc dot gnu.org
2014-07-09  0:36 ` shapero at uw dot edu
2015-08-31 15:44 ` paolo.carlini at oracle dot com
2015-09-01  8:40 ` paolo 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).