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++/16777] [3.3 Regression] Trouble with qualified declaration in class


------- Additional Comments From bangerth at dealii dot org  2004-07-27 03:38 -------
That's actually a strange piece of code:  
-------------------  
struct X {  
    template <typename> void foo();  
   
    void X::bar() {  
      this->X::foo<int>();  
    }  
};  
-------------------  
gcc 3.2, 3.4 and mainline actually accept the odd declaration using the   
qualification X:: of the member function, whereas 3.3 somehow manages  
to ICE (this is with checking enabled, of course):  
  
g/x> /home/bangerth/bin/gcc-3.3.4-pre/bin/c++ -c x.cc  
x.cc: In member function `void X::bar()':  
x.cc:6: internal compiler error: tree check: expected identifier_node, have   
   baselink in cxx_scope_find_binding_for_name, at cp/decl.c:2384  
Please submit a full bug report,  
with preprocessed source if appropriate.  
  
So there are two bugs: that 3.3.x ICEs, and that the other compilers  
actually accept the code. I'd bet that it is invalid; btw, icc8 says  
  
g/x> icc -Xc -ansi -c x.cc  
x.cc(4): warning #470: qualified name is not allowed in member declaration  
      void X::bar()  
           ^  
  
W.  

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[3.3 Regression] C++ parse  |[3.3 Regression] Trouble
                   |error in 3.3, OK in 3.2 and |with qualified declaration
                   |3.4                         |in class


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


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