[Bug c++/15269] __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Mon May 3 19:17:00 GMT 2004


------- Additional Comments From bangerth at dealii dot org  2004-05-03 19:17 -------
Confirmed the last problem as well. In the example you pasted, you 
were missing a semicolon after the the struct declaration. Here is  
a corrected version: 
------------ 
struct B { 
    void foo() __attribute__((deprecated)); 
}; 
 
void B::foo() {} 
void demo() { ((B*)0)->foo(); } 
------------- 
 
This yields: 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc 
x.cc: In function `void demo()': 
x.cc:6: warning: `foo' is deprecated (declared at x.cc:5) 
 
with indeed the warning referencing the _definition_, not the _declaration_. 
 
To summarize: the failures we still have are the one in this comment 
as well as the first example in my comment #2. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdr at gcc dot gnu dot org
           Keywords|                            |diagnostic


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



More information about the Gcc-bugs mailing list