gcc-19991102 incorrectly flags "conflicting type" on correct code

Corey Kosak kosak@cs.cmu.edu
Sun Nov 7 14:13:00 GMT 1999


> cat -n bug.cc && g++ -v && g++ bug.cc
     1  enum {foo1=10};
     2  
     3  struct s { enum {foo2=20}; };
     4  
     5  template<class T> struct cow {
     6    static int     int1[   foo1];
     7    static int     int2[s::foo2];
     8    static cow<T> *cow1[   foo1];
     9    static cow<T> *cow2[s::foo2];
    10  };
    11  
    12  template<class T> int     cow<T>::int1[   foo1];  //ok
    13  template<class T> int     cow<T>::int2[s::foo2];  //ok
    14  template<class T> cow<T> *cow<T>::cow1[   foo1];  //ok
    15  template<class T> cow<T> *cow<T>::cow2[s::foo2];  //FAIL
    16  
    17  
Reading specs from /usr/local/libexec/gcc-19991102/lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 19991102 (experimental)
bug.cc:15: conflicting types for `cow<T> *cow<T>::cow2[foo2]'
bug.cc:9: previous declaration as `cow<T> *cow<T>::cow2[s::foo2]'


More information about the Gcc-bugs mailing list