This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15179] Error message can be improved


------- Additional Comments From bangerth at dealii dot org  2004-04-28 00:00 -------
Confirmed. For this code 
----------- 
template <class T> class O { 
    typedef O<T> Type; 
    typedef int inner; 
    class I 
    { 
        typedef Type::inner inner; 
    }; 
}; 
----------- 
gcc produces 
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc 
x.cc:6: error: type `O<T>' is not derived from type `O<T>::I' 
x.cc:6: error: ISO C++ forbids declaration of `inner' with no type 
x.cc:6: error: expected `;' before "inner" 
 
which is indeed confusing. (icc, for reference, simply accepts the code 
even with -Xc -ansi -- which is probably wrong.) 
 
Frankly, I have no clue what path in the compiler we are taking to get 
to this error message... 
 
W. 

-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]