Bug 11039

Summary: [3.3 regression] Bad interaction between implicit typename deprecation and friendship
Product: gcc Reporter: Wolfgang Bangerth <bangerth>
Component: c++Assignee: Kriang Lerdsuwanakij <lerdsuwa>
Status: RESOLVED FIXED    
Severity: critical CC: gcc-bugs, lerdsuwa
Priority: P1    
Version: 3.3   
Target Milestone: 3.3.1   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2003-05-31 17:54:42

Description Wolfgang Bangerth 2003-05-30 19:37:33 UTC
This doesn't compile without a warning on 3.3 (and 3.2.3 FWIW):
--------------------------------
template <typename T> struct X {
    struct Y {
	struct Z {};
    };
    
    friend struct Y::Z;
};
--------------------------------

g/x> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c x.cc
x.cc:6: warning: `X<T>::Y::Z' is implicitly a typename
x.cc:6: warning: implicit typename is deprecated, please see the documentation
   for details

That's bogus, of course. It's particularly bad, since this warning
cannot be switched off and thus makes use of -Werror unusable on some
code :-( Since it compiled just fine without problems prior to the
implicit typename deprecation, I rate this as a regression.

It works just fine on mainline.

Kriang, would you mind taking a look?

W.

PS: Yes, I know the friend declaration isn't necessary. It's just,
some other compilers don't :-((
Comment 1 Kriang Lerdsuwanakij 2003-06-08 10:53:26 UTC
Fixed in 3.3 branch.