This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64259] New: Erroneous "declaration 'struct ...' does not declare anything" when using "typename"
- From: "rutsky.vladimir at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 11 Dec 2014 00:37:33 +0000
- Subject: [Bug c++/64259] New: Erroneous "declaration 'struct ...' does not declare anything" when using "typename"
- Auto-submitted: auto-generated
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.