public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15269] __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition
       [not found] <bug-15269-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-11 20:25 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-11 20:25 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2005-05-01 03:42:59         |2021-8-11

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So to summary here, the only problem left is the following testcase:
// { dg-do compile }
struct B { 
    void foo() __attribute__((deprecated)); // { dg-message "note" }
}; 

void B::foo() {} // { dg-bogus "" }
void demo() { ((B*)0)->foo(); } // { dg-warning "" }

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15269] __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition
       [not found] <bug-15269-8457@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2007-09-23  4:40 ` jason at gcc dot gnu dot org
@ 2007-09-25 15:54 ` eddy at opera dot com
  3 siblings, 0 replies; 9+ messages in thread
From: eddy at opera dot com @ 2007-09-25 15:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from eddy at opera dot com  2007-09-25 15:54 -------
Subject: Re:  __attribute__((deprecated)) broken with inline, ignored with pure
virtual, misreported after definition

> Virtual problem fixed for 4.3.0.

Yay !
Thank you :-)

        Eddy.


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15269] __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition
       [not found] <bug-15269-8457@http.gcc.gnu.org/bugzilla/>
  2007-09-23  4:33 ` jason at gcc dot gnu dot org
  2007-09-23  4:37 ` jason at gcc dot gnu dot org
@ 2007-09-23  4:40 ` jason at gcc dot gnu dot org
  2007-09-25 15:54 ` eddy at opera dot com
  3 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-09-23  4:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jason at gcc dot gnu dot org  2007-09-23 04:39 -------
Virtual problem fixed for 4.3.0.


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15269] __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition
       [not found] <bug-15269-8457@http.gcc.gnu.org/bugzilla/>
  2007-09-23  4:33 ` jason at gcc dot gnu dot org
@ 2007-09-23  4:37 ` jason at gcc dot gnu dot org
  2007-09-23  4:40 ` jason at gcc dot gnu dot org
  2007-09-25 15:54 ` eddy at opera dot com
  3 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-09-23  4:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jason at gcc dot gnu dot org  2007-09-23 04:37 -------
Subject: Bug 15269

Author: jason
Date: Sun Sep 23 04:37:26 2007
New Revision: 128682

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128682
Log:
        PR c++/15269
        * call.c (build_over_call): Warn about deprecated virtuals.

Added:
    trunk/gcc/testsuite/g++.dg/warn/deprecated-4.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15269] __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition
       [not found] <bug-15269-8457@http.gcc.gnu.org/bugzilla/>
@ 2007-09-23  4:33 ` jason at gcc dot gnu dot org
  2007-09-23  4:37 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-09-23  4:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jason at gcc dot gnu dot org  2007-09-23 04:33 -------
About #3: When we see the definition of a function, we don't keep information
about where it was first declared.  For member functions, we could give the
source position of the class if that would be helplful.


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15269] __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition
  2004-05-03 18:08 [Bug c++/15269] New: " gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-05-03 19:17 ` bangerth at dealii dot org
@ 2004-05-03 19:20 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-03 19:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-03 19:20 -------
For the last example I can confirm it also on the mainline, I think the problem is when creating the 
second decl for the definition.  For the virtual issue is that there is an indirect call to the function's entry 
in the vtable and that entry does not have the attribute on it. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15269] __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition
  2004-05-03 18:08 [Bug c++/15269] New: " gcc-bugzilla at gcc dot gnu dot org
  2004-05-03 18:39 ` [Bug c++/15269] " bangerth at dealii dot org
  2004-05-03 19:08 ` eddy at opera dot com
@ 2004-05-03 19:17 ` bangerth at dealii dot org
  2004-05-03 19:20 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2004-05-03 19:17 UTC (permalink / raw)
  To: gcc-bugs


------- 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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15269] __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition
  2004-05-03 18:08 [Bug c++/15269] New: " gcc-bugzilla at gcc dot gnu dot org
  2004-05-03 18:39 ` [Bug c++/15269] " bangerth at dealii dot org
@ 2004-05-03 19:08 ` eddy at opera dot com
  2004-05-03 19:17 ` bangerth at dealii dot org
  2004-05-03 19:20 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 9+ messages in thread
From: eddy at opera dot com @ 2004-05-03 19:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From eddy at opera dot com  2004-05-03 19:08 -------
Subject: Re:  __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition

Nice to see the inline problem is fixed already :^)

Unless it's also been fixed in the interval,
problem number three is this:

-----------
struct B {
    void foo() __attribute__((deprecated)); // declaration
    // documentation of why it's deprecated, how to dispense with it
}
void B::foo() { return; } // definition
void demo(void) { ((B*)0)->foo(); } // gets warning
-----------

the compiler's warning says foo was declared at line 5 when it was
actually declared at line 2.  If (as will be true in any real example)
the declaration is in a header file and the definition is in a
separate source file, whoever comes along to fix the warning is going
to be directed to the definition, which doesn't have the documentation
of why the method is decremented and how to do without it.

This will be particularly monstrous if in fact the attribute is on a
distant base class of B (I can't test this because of problem number
one): the implementation of (some class in the same compilation unit
as) B calls the foo of a B object after B has defined foo; the warning
*really* needs to reference the far off header file which defines the
base class ... being told about B's implementation of foo will be
little use !

	Eddy.


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15269] __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition
  2004-05-03 18:08 [Bug c++/15269] New: " gcc-bugzilla at gcc dot gnu dot org
@ 2004-05-03 18:39 ` bangerth at dealii dot org
  2004-05-03 19:08 ` eddy at opera dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2004-05-03 18:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-05-03 18:39 -------
Confirmed. There are multiple problems: 
---------- 
struct B { 
    virtual int foo() __attribute__((deprecated)); 
}; 
 
int main(void) { 
  ((B*)0)->foo(); 
} 
---------- 
The compiler should warn, but doesn't. It does if the 'virtual' is 
removed. 
 
Problem number two is this: 
------------ 
struct B { 
    int foo() __attribute__((deprecated)) {}; 
}; 
------------ 
This doesn't compile with gcc up  to 3.3.4. However, it is already fixed 
with the new parser in 3.4.0, so this is ok now.  
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-03 18:39:51
               date|                            |


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-08-11 20:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-15269-4@http.gcc.gnu.org/bugzilla/>
2021-08-11 20:25 ` [Bug c++/15269] __attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition pinskia at gcc dot gnu.org
     [not found] <bug-15269-8457@http.gcc.gnu.org/bugzilla/>
2007-09-23  4:33 ` jason at gcc dot gnu dot org
2007-09-23  4:37 ` jason at gcc dot gnu dot org
2007-09-23  4:40 ` jason at gcc dot gnu dot org
2007-09-25 15:54 ` eddy at opera dot com
2004-05-03 18:08 [Bug c++/15269] New: " gcc-bugzilla at gcc dot gnu dot org
2004-05-03 18:39 ` [Bug c++/15269] " bangerth at dealii dot org
2004-05-03 19:08 ` eddy at opera dot com
2004-05-03 19:17 ` bangerth at dealii dot org
2004-05-03 19:20 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).