------- Comment #4 from bangerth at dealii dot org  2008-01-13 02:31 -------
(In reply to comment #0)
> template <typename> class X {};
> 
> class Y {
>         typedef X<int> X;
> };
> 
> 
> produces the following error:
> redef.cpp:4: error: declaration of 'typedef class X<int> Y::X'
> redef.cpp:1: error: changes meaning of 'X' from 'class X<int>'

What the error message says is this: before the typedef declaration,
referring to the name 'X' inside the class refers to the global
template ::X. After the declaration, 'X' inside the class refers
to the typedef. C++ does not allow declarations to change the
meaning of names.

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34531

Reply via email to