c++/7348: More recent access control problems, and wrong implicit typename warnings

wolfgang.bangerth@iwr.uni-heidelberg.de wolfgang.bangerth@iwr.uni-heidelberg.de
Thu Jul 18 05:19:00 GMT 2002


>Number:         7348
>Category:       c++
>Synopsis:       More recent access control problems, and wrong implicit typename warnings
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 18 01:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
gcc 3.2 pre 2002-07-17
>Description:
The following fails to compile:
---------------------------------------------
class Outer {
    template <int dim> struct Inner {
	typedef int T;
	T foo ();
    };
  public:
    Outer();
};

template <int dim>
typename Outer::Inner<dim>::T  Outer::Inner<dim>::foo () {
  return 1;
};

template Outer::Inner<2>;
--------------------------------------------

The messages are:
x.cc:2: error: `template<int dim> struct Outer::Inner' is private
x.cc:11: error: within this context
x.cc:11: warning: `Outer::Inner<dim>::T' is implicitly a
          typename
x.cc:11: warning: implicit typename is deprecated, please 
          see the documentation for details

Since Outer::Inner<dim>::T is the only way to access the 
return type of the function, this must be allowed. 
Furthermore, the implicit typename warning is bogus, since 
there a "typename" on this very line.

This, just as c++/7347 is a new failure. Again, the bug
goes away if the inner class is not a template, which is 
suspicious at best :-)

Regards
  Wolfgang
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list