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++/16175] [3.3/3.4/3.5 regression] Wrong type reported in diagnostic


------- Additional Comments From bangerth at dealii dot org  2004-06-25 16:27 -------
Confirmed. This is indeed confusing: 
--------------------- 
template <typename> struct Template {}; 
 
template<template<typename> class D> 
struct B { 
    static void foo(const D<void> *); 
}; 
 
class D : protected B<Template> {}; 
 
void bar() { 
  D::foo (0); 
} 
--------------------------- 
 
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -w -c x.cc  
x.cc: In function `void bar()': 
x.cc:5: error: `static void B<D>::foo(D<void>*) [with D = Template]' is 
inaccessible 
x.cc:11: error: within this context 
 
Note that it refers to the argument of foo as a non-const pointer, even 
though it really is a const pointer. 
 
This is a regression over 2.95, which printed 
g/x> /home/bangerth/bin/gcc-2*/bin/c++ -w -c x.cc  
x.cc: In function `void bar()': 
x.cc:5: `static void B<Template>::foo(const Template<void> *)' is inaccessible 
x.cc:11: within this context 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdr at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
      Known to fail|                            |3.2.3 3.3.3 3.4.0 3.5.0
      Known to work|                            |2.95.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-25 16:27:09
               date|                            |
            Summary|Wrong type reported in      |[3.3/3.4/3.5 regression]
                   |diagnostic                  |Wrong type reported in
                   |                            |diagnostic
   Target Milestone|---                         |3.4.2


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


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