public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19200] New: Friend declaration misinterpreted as constructor
@ 2004-12-30 11:53 giovannibajo at libero dot it
  2004-12-30 11:54 ` [Bug c++/19200] " giovannibajo at libero dot it
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-12-30 11:53 UTC (permalink / raw)
  To: gcc-bugs

Hello:

-------------------------------
struct S {
   struct T{};
   friend void S(T);
};
-------------------------------
lookup.cc:3: error: return type specification for constructor invalid
lookup.cc:3: warning: member functions are implicitly friends of their class


G++ thinks that the friend declaration is declaring the constructor (with an 
invalid return type specification) as friend. This is bogus of course.

It might be a regression, but it was there at least in 3.3.

-- 
           Summary: Friend declaration misinterpreted as constructor
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: giovannibajo at libero dot it
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/19200] Friend declaration misinterpreted as constructor
  2004-12-30 11:53 [Bug c++/19200] New: Friend declaration misinterpreted as constructor giovannibajo at libero dot it
@ 2004-12-30 11:54 ` giovannibajo at libero dot it
  2004-12-30 14:33 ` pinskia at gcc dot gnu dot org
  2005-01-18 20:17 ` reichelt at gcc dot gnu dot org
  2 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-12-30 11:54 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.0.0 3.4.2 3.3.3


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


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

* [Bug c++/19200] Friend declaration misinterpreted as constructor
  2004-12-30 11:53 [Bug c++/19200] New: Friend declaration misinterpreted as constructor giovannibajo at libero dot it
  2004-12-30 11:54 ` [Bug c++/19200] " giovannibajo at libero dot it
@ 2004-12-30 14:33 ` pinskia at gcc dot gnu dot org
  2005-01-18 20:17 ` reichelt at gcc dot gnu dot org
  2 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-30 14:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-30 14:33 -------
If this is a regression, it has to be from 2.95.3 which I don't have access to right now.

Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|4.0.0 3.4.2 3.3.3           |4.0.0 3.4.2 3.3.3 3.0 2.97
   Last reconfirmed|0000-00-00 00:00:00         |2004-12-30 14:33:16
               date|                            |


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


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

* [Bug c++/19200] Friend declaration misinterpreted as constructor
  2004-12-30 11:53 [Bug c++/19200] New: Friend declaration misinterpreted as constructor giovannibajo at libero dot it
  2004-12-30 11:54 ` [Bug c++/19200] " giovannibajo at libero dot it
  2004-12-30 14:33 ` pinskia at gcc dot gnu dot org
@ 2005-01-18 20:17 ` reichelt at gcc dot gnu dot org
  2 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-01-18 20:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2005-01-18 20:17 -------
Not a regression.
\x13

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|                            |monitored


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


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

* [Bug c++/19200] Friend declaration misinterpreted as constructor
       [not found] <bug-19200-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-06-11 16:28 ` paolo.carlini at oracle dot com
@ 2014-06-12  1:30 ` paolo at gcc dot gnu.org
  3 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-06-12  1:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Thu Jun 12 01:29:42 2014
New Revision: 211488

URL: http://gcc.gnu.org/viewcvs?rev=211488&root=gcc&view=rev
Log:
/cp
2014-06-11  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/19200
    * parser.c (cp_parser_init_declarator): Actually pass friend_p
    to cp_parser_declarator.

/testsuite
2014-06-11  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/19200
    * g++.dg/parse/friend11.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/parse/friend11.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/19200] Friend declaration misinterpreted as constructor
       [not found] <bug-19200-4@http.gcc.gnu.org/bugzilla/>
  2014-06-09 21:30 ` paolo.carlini at oracle dot com
  2014-06-11 15:17 ` paolo at gcc dot gnu.org
@ 2014-06-11 16:28 ` paolo.carlini at oracle dot com
  2014-06-12  1:30 ` paolo at gcc dot gnu.org
  3 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-11 16:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org
   Target Milestone|---                         |4.10.0

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.10.0.


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

* [Bug c++/19200] Friend declaration misinterpreted as constructor
       [not found] <bug-19200-4@http.gcc.gnu.org/bugzilla/>
  2014-06-09 21:30 ` paolo.carlini at oracle dot com
@ 2014-06-11 15:17 ` paolo at gcc dot gnu.org
  2014-06-11 16:28 ` paolo.carlini at oracle dot com
  2014-06-12  1:30 ` paolo at gcc dot gnu.org
  3 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-06-11 15:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Wed Jun 11 15:16:45 2014
New Revision: 211467

URL: http://gcc.gnu.org/viewcvs?rev=211467&root=gcc&view=rev
Log:
/cp
2014-06-11  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/19200
    * parser.c (cp_parser_declarator): Add bool parameter.
    (cp_parser_direct_declarator): Likewise, use it.
    (cp_parser_member_declaration): Pass friend_p to cp_parser_declarator.
    (cp_parser_condition, cp_parser_explicit_instantiation,
    cp_parser_init_declarator, cp_parser_type_id_1,
    cp_parser_parameter_declaration, cp_parser_exception_declaration,
    cp_parser_cache_defarg, cp_parser_objc_class_ivars,
    cp_parser_objc_struct_declaration, cp_parser_omp_for_loop_init):
    Adjust.
    * decl.c (grokdeclarator): Fix handling of friend declared in
    namespace scope (g++.dg/parse/friend10.C).

/testsuite
2014-06-11  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/19200
    * g++.dg/parse/friend9.C: New.
    * g++.dg/parse/friend10.C: Likewise.
    * g++.dg/parse/friend7.C: Adjust.


Added:
    trunk/gcc/testsuite/g++.dg/parse/friend10.C
    trunk/gcc/testsuite/g++.dg/parse/friend9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/parse/friend7.C


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

* [Bug c++/19200] Friend declaration misinterpreted as constructor
       [not found] <bug-19200-4@http.gcc.gnu.org/bugzilla/>
@ 2014-06-09 21:30 ` paolo.carlini at oracle dot com
  2014-06-11 15:17 ` paolo at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-09 21:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.


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

end of thread, other threads:[~2014-06-12  1:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-30 11:53 [Bug c++/19200] New: Friend declaration misinterpreted as constructor giovannibajo at libero dot it
2004-12-30 11:54 ` [Bug c++/19200] " giovannibajo at libero dot it
2004-12-30 14:33 ` pinskia at gcc dot gnu dot org
2005-01-18 20:17 ` reichelt at gcc dot gnu dot org
     [not found] <bug-19200-4@http.gcc.gnu.org/bugzilla/>
2014-06-09 21:30 ` paolo.carlini at oracle dot com
2014-06-11 15:17 ` paolo at gcc dot gnu.org
2014-06-11 16:28 ` paolo.carlini at oracle dot com
2014-06-12  1:30 ` 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).