[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2020-01-06 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12333

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |10.0

--- Comment #20 from Jason Merrill  ---
Fixed for GCC 10.

[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2019-12-18 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12333

--- Comment #19 from Jason Merrill  ---
Author: jason
Date: Wed Dec 18 12:44:34 2019
New Revision: 279522

URL: https://gcc.gnu.org/viewcvs?rev=279522&root=gcc&view=rev
Log:
PR c++/12333 - X::~X() with implicit this->.

this->X::~X() is handled by finish_class_member_access_expr and its
lookup_destructor subroutine; let's use it in cp_parser_lookup_name for the
case where this-> is implicit.

I tried replacing the other destructor code here with just the call to
lookup_destructor, but that regressed handling of naming the destructor
outside a non-static member function.

* parser.c (cp_parser_lookup_name): Use lookup_destructor.
* typeck.c (lookup_destructor): No longer static.

Added:
trunk/gcc/testsuite/g++.dg/lookup/dtor1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/parser.c
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/g++.dg/parse/dtor3.C

[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2019-12-17 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12333

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||jason at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2018-06-25 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12333

Jonathan Wakely  changed:

   What|Removed |Added

 CC||zhonghao at pku dot org.cn

--- Comment #18 from Jonathan Wakely  ---
*** Bug 86305 has been marked as a duplicate of this bug. ***

[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2018-02-20 Thread hiraditya at msn dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12333

--- Comment #17 from AK  ---
The following workarounds do not emit compiler errors, although I'm not sure if
second option is a correct workaround.

1. this->~X();
2. X::~X(0);

FYI,
ICC 18 also has the same bug. The first workaround works for ICC but not the
second one.

[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2017-01-11 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12333

Martin Sebor  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org
  Known to fail||3.3, 4.5.3, 4.8.3, 4.9.3,
   ||5.3.0, 6.3.0, 7.0

--- Comment #16 from Martin Sebor  ---
Today's top of trunk (GCC 7.0) still fails.  Other compilers, including Clang
and Oracle Solaris Studio, accept the code.

$ cat t.C && gcc -O2 -S -Wall -Wextra t.C
struct X { 
  void f () { 
X::~X ();  
  }  
};  
t.C: In member function ‘void X::f()’:
t.C:3:12: error: no matching function for call to ‘X::X()’
 X::~X ();
^
t.C:1:8: note: candidate: X::~X()
 struct X {
^
t.C:1:8: note:   candidate expects 1 argument, 0 provided

[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2014-06-24 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12333

Paolo Carlini  changed:

   What|Removed |Added

 Status|ASSIGNED|NEW
   Assignee|paolo.carlini at oracle dot com|unassigned at gcc dot 
gnu.org


[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2013-07-03 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12333

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC|gcc-bugs at gcc dot gnu.org|
   Assignee|unassigned at gcc dot gnu.org  |paolo.carlini at oracle 
dot com

--- Comment #15 from Paolo Carlini  ---
Looking into this.


[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2012-01-18 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12333

--- Comment #14 from Andrew Pinski  2012-01-19 
06:14:08 UTC ---
Now the diagnostic says:
t7.cc:3:13: error: no matching function for call to ‘X::~X()’
t7.cc:3:13: note: candidate is:
t7.cc:5:13: note: virtual X::~X()
t7.cc:5:13: note:   candidate expects 1 argument, 0 provided


[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2010-03-25 Thread pinskia at gcc dot gnu dot org


--- Comment #13 from pinskia at gcc dot gnu dot org  2010-03-25 18:16 
---
Related to PR 12228.


-- 


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



[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2006-09-13 Thread pinskia at gcc dot gnu dot org


--- Comment #12 from pinskia at gcc dot gnu dot org  2006-09-13 18:29 
---
*** Bug 29065 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||amylaar at gcc dot gnu dot
   ||org


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



[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2005-11-26 Thread gdr at gcc dot gnu dot org


--- Comment #11 from gdr at gcc dot gnu dot org  2005-11-26 08:10 ---
This is reject-valid.


-- 

gdr at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||gdr at gcc dot gnu dot org
   Keywords|diagnostic  |


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



[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2005-09-30 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-30 
23:41 ---
*** Bug 24155 has been marked as a duplicate of this bug. ***

-- 
   What|Removed |Added

 CC||mon at hks dot com


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


[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2005-06-19 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-19 
14:27 ---
*** Bug 19243 has been marked as a duplicate of this bug. ***

-- 


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


[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2005-01-04 Thread austern at apple dot com

--- Additional Comments From austern at apple dot com  2005-01-05 05:24 
---
I was wrong in thinking this was only a diagnostic bug.  DR272 only affects a 
nonnormative note.  I've 
checked with Mike Miller, and he pointed me to the appropriate normative text 
that implies that X::~X() 
within a member function designates the destructor.  This is a genuine 
rejects-valid bug, not just a bad 
diagnostic.  It is a rejects-valid bug regardless of the status of DR272.

-- 


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


[Bug c++/12333] [DR 272] Explicit call to MyClass::~MyClass() not allowed

2005-01-03 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-03 
20:52 ---
*** Bug 19243 has been marked as a duplicate of this bug. ***

-- 
   What|Removed |Added

 CC||austern at apple dot com


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