public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64259] New: Erroneous "declaration 'struct ...' does not declare anything" when using "typename"
@ 2014-12-11  0:37 rutsky.vladimir at gmail dot com
  2014-12-11 10:36 ` [Bug c++/64259] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rutsky.vladimir at gmail dot com @ 2014-12-11  0:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64259
           Summary: Erroneous "declaration 'struct ...' does not declare
                    anything" when using "typename"
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rutsky.vladimir at gmail dot com

Consider following example:

$ cat /tmp/test.cpp 
class A;

namespace details
{
    struct B {};
}

using BB = typename details::B;

$ g++-4.9 -std=c++11 -c /tmp/test.cpp 
/tmp/test.cpp:8:30: warning: declaration 'struct details::B' does not declare
anything
 using BB = typename details::B;
                              ^
$ g++-4.9 --version
g++-4.9 (Ubuntu 4.9.2-0ubuntu1~14.04) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Code compiles without warnings with clang 3.5.


If I remove (uneeded) typename:

using BB = details::B;

code compiles with GCC without warnings.


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

* [Bug c++/64259] Erroneous "declaration 'struct ...' does not declare anything" when using "typename"
  2014-12-11  0:37 [Bug c++/64259] New: Erroneous "declaration 'struct ...' does not declare anything" when using "typename" rutsky.vladimir at gmail dot com
@ 2014-12-11 10:36 ` redi at gcc dot gnu.org
  2020-03-12 18:41 ` mpolacek at gcc dot gnu.org
  2021-08-04  3:26 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2014-12-11 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-12-11
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Confirmed. Every version since 4.7.0 has given the same warning (but not a
regression as 4.6 didn't support the syntax at all).


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

* [Bug c++/64259] Erroneous "declaration 'struct ...' does not declare anything" when using "typename"
  2014-12-11  0:37 [Bug c++/64259] New: Erroneous "declaration 'struct ...' does not declare anything" when using "typename" rutsky.vladimir at gmail dot com
  2014-12-11 10:36 ` [Bug c++/64259] " redi at gcc dot gnu.org
@ 2020-03-12 18:41 ` mpolacek at gcc dot gnu.org
  2021-08-04  3:26 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-03-12 18:41 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
GCC 10 still prints the warning:

64259.C:8:30: warning: declaration ‘struct details::B’ does not declare
anything
    8 | using BB = typename details::B;
      |                              ^

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

* [Bug c++/64259] Erroneous "declaration 'struct ...' does not declare anything" when using "typename"
  2014-12-11  0:37 [Bug c++/64259] New: Erroneous "declaration 'struct ...' does not declare anything" when using "typename" rutsky.vladimir at gmail dot com
  2014-12-11 10:36 ` [Bug c++/64259] " redi at gcc dot gnu.org
  2020-03-12 18:41 ` mpolacek at gcc dot gnu.org
@ 2021-08-04  3:26 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-04  3:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 66159 which is fixed in GCC 11+.

*** This bug has been marked as a duplicate of bug 66159 ***

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

end of thread, other threads:[~2021-08-04  3:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-11  0:37 [Bug c++/64259] New: Erroneous "declaration 'struct ...' does not declare anything" when using "typename" rutsky.vladimir at gmail dot com
2014-12-11 10:36 ` [Bug c++/64259] " redi at gcc dot gnu.org
2020-03-12 18:41 ` mpolacek at gcc dot gnu.org
2021-08-04  3:26 ` pinskia 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).