$ cat >bug.cxx
template <typename T>
struct A
{
typedef T S;
};
struct S {};
struct B : S {};
struct C: B, A<S>
{
friend class A<S>;
};
$ g++-3.4 --version
g++-3.4 (GCC) 3.4.4 20050314 (prerelease) (Debian 3.4.3-12)
$ g++-3.4 -c bug.cxx
bug.cxx:13: error: `S' was not declared in this scope
bug.cxx:13: error: template argument 1 is invalid
bug.cxx:13: error: friend declaration does not name a class or function
icc 8.1 compiles this without any diagnostic.
--
Summary: unable to resolve visible symbol
Product: gcc
Version: 3.4.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: boris at kolpackov dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: x86_64-pc-linux-gnu
GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21146