* [Bug c++/13714] destructor name `const s' does not match type `const s' of expression
2004-01-16 21:49 [Bug c++/13714] New: destructor name `const s' does not match type `const s' of expression marcus at jet dot franken dot de
@ 2004-01-16 21:49 ` marcus at jet dot franken dot de
2004-01-16 21:50 ` [Bug c++/13714] [3.4] " marcus at jet dot franken dot de
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: marcus at jet dot franken dot de @ 2004-01-16 21:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From marcus at jet dot franken dot de 2004-01-16 21:49 -------
Created an attachment (id=5505)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5505&action=view)
testcase
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13714
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/13714] [3.4] destructor name `const s' does not match type `const s' of expression
2004-01-16 21:49 [Bug c++/13714] New: destructor name `const s' does not match type `const s' of expression marcus at jet dot franken dot de
2004-01-16 21:49 ` [Bug c++/13714] " marcus at jet dot franken dot de
@ 2004-01-16 21:50 ` marcus at jet dot franken dot de
2004-01-16 22:57 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: marcus at jet dot franken dot de @ 2004-01-16 21:50 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|destructor name `const s' |[3.4] destructor name `const
|does not match type `const |s' does not match type
|s' of expression |`const s' of expression
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13714
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/13714] [3.4] destructor name `const s' does not match type `const s' of expression
2004-01-16 21:49 [Bug c++/13714] New: destructor name `const s' does not match type `const s' of expression marcus at jet dot franken dot de
2004-01-16 21:49 ` [Bug c++/13714] " marcus at jet dot franken dot de
2004-01-16 21:50 ` [Bug c++/13714] [3.4] " marcus at jet dot franken dot de
@ 2004-01-16 22:57 ` pinskia at gcc dot gnu dot org
2004-01-16 23:45 ` [Bug c++/13714] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-16 22:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-16 22:57 -------
Looks like the new parser did this.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13714
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/13714] destructor name `const s' does not match type `const s' of expression
2004-01-16 21:49 [Bug c++/13714] New: destructor name `const s' does not match type `const s' of expression marcus at jet dot franken dot de
` (2 preceding siblings ...)
2004-01-16 22:57 ` pinskia at gcc dot gnu dot org
@ 2004-01-16 23:45 ` pinskia at gcc dot gnu dot org
2004-01-17 0:13 ` rschiele at uni-mannheim dot de
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-16 23:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-16 23:45 -------
The code is invalid, you cannot call the destructor with a different name (even though it is a
typedef name). So the only problem here is error message is wrong.
Confirmed on the mainline and the 3.4 branch.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2004-01-16 23:45:40
date| |
Summary|[3.4] destructor name `const|destructor name `const s'
|s' does not match type |does not match type `const
|`const s' of expression |s' of expression
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13714
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/13714] destructor name `const s' does not match type `const s' of expression
2004-01-16 21:49 [Bug c++/13714] New: destructor name `const s' does not match type `const s' of expression marcus at jet dot franken dot de
` (3 preceding siblings ...)
2004-01-16 23:45 ` [Bug c++/13714] " pinskia at gcc dot gnu dot org
@ 2004-01-17 0:13 ` rschiele at uni-mannheim dot de
2004-01-17 4:13 ` giovannibajo at libero dot it
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rschiele at uni-mannheim dot de @ 2004-01-17 0:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rschiele at uni-mannheim dot de 2004-01-17 00:13 -------
Andrew, I think you are wrong here. The standard (2003 revision) says in
section 12.4 paragraph 12:
"In an explicit destructor call, the destructor name appears as a ~ followed
by a type-name that names the destructor's class type."
As far as I read this sentence, it can be _any_ name that names the class
type.
There is even an informative example in the same section with code that is
claimed to be correct C++ code and triggers the same bug.
For those that do not have the standard availlable, the code without the line
that is commented to be erroneous is:
struct B {
virtual ~B() { }
};
struct D : B {
~D() { }
};
D D_object;
typedef B B_alias;
B* B_ptr = &D_object;
void f() {
D_object.B::~B();
B_ptr->~B();
B_ptr->~B();
B_ptr->~B_alias();
B_ptr->B_alias::~B();
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13714
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/13714] destructor name `const s' does not match type `const s' of expression
2004-01-16 21:49 [Bug c++/13714] New: destructor name `const s' does not match type `const s' of expression marcus at jet dot franken dot de
` (4 preceding siblings ...)
2004-01-17 0:13 ` rschiele at uni-mannheim dot de
@ 2004-01-17 4:13 ` giovannibajo at libero dot it
2004-01-17 4:20 ` [Bug c++/13714] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-17 4:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-01-17 04:13 -------
There are a few open DRs in the standard about name lookup for pseudo
destructor calls, I'll have to review those. But I know they are about relaxing
the requirements.
The pure standard however says that the pseudo destructor name is looked up in
the scope of the nested name specifier in the postfix expression. This makes
your testcase obviously well-formed, so, as a first approximation, this is a
rejects-valid.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords|diagnostic |rejects-valid
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13714
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/13714] [3.4/3.5 Regression] destructor name `const s' does not match type `const s' of expression
2004-01-16 21:49 [Bug c++/13714] New: destructor name `const s' does not match type `const s' of expression marcus at jet dot franken dot de
` (5 preceding siblings ...)
2004-01-17 4:13 ` giovannibajo at libero dot it
@ 2004-01-17 4:20 ` pinskia at gcc dot gnu dot org
2004-02-05 19:33 ` mmitchel at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-17 4:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-17 04:20 -------
It also makes a 3.4/3.5 regression then.
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|destructor name `const s' |[3.4/3.5 Regression]
|does not match type `const |destructor name `const s'
|s' of expression |does not match type `const
| |s' of expression
Target Milestone|--- |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13714
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/13714] [3.4/3.5 Regression] destructor name `const s' does not match type `const s' of expression
2004-01-16 21:49 [Bug c++/13714] New: destructor name `const s' does not match type `const s' of expression marcus at jet dot franken dot de
` (6 preceding siblings ...)
2004-01-17 4:20 ` [Bug c++/13714] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-02-05 19:33 ` mmitchel at gcc dot gnu dot org
2004-02-05 19:45 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-02-05 19:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-02-05 19:33 -------
This code is invalid, according to the current standard, although the error
message is misleading.
The example in 12.4/2 (even as amended by DR 244) does not mention cv-qualification.
The standard says that the destructor name must name "the destructor's class
type", not must name "a possibly cv-qualified variant of the destructor's class
type."
I am working on a fix for the error message.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13714
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/13714] [3.4/3.5 Regression] destructor name `const s' does not match type `const s' of expression
2004-01-16 21:49 [Bug c++/13714] New: destructor name `const s' does not match type `const s' of expression marcus at jet dot franken dot de
` (7 preceding siblings ...)
2004-02-05 19:33 ` mmitchel at gcc dot gnu dot org
@ 2004-02-05 19:45 ` cvs-commit at gcc dot gnu dot org
2004-02-05 19:45 ` cvs-commit at gcc dot gnu dot org
2004-02-05 19:46 ` mmitchel at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-05 19:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-02-05 19:45 -------
Subject: Bug 13714
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: mmitchel@gcc.gnu.org 2004-02-05 19:45:20
Modified files:
gcc/cp : ChangeLog typeck.c
Log message:
PR c++/13714
* typeck.c (lookup_destructor): Tweak error message.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.38&r2=1.3892.2.39
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.519.2.5&r2=1.519.2.6
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13714
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/13714] [3.4/3.5 Regression] destructor name `const s' does not match type `const s' of expression
2004-01-16 21:49 [Bug c++/13714] New: destructor name `const s' does not match type `const s' of expression marcus at jet dot franken dot de
` (8 preceding siblings ...)
2004-02-05 19:45 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-05 19:45 ` cvs-commit at gcc dot gnu dot org
2004-02-05 19:46 ` mmitchel at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-05 19:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-02-05 19:45 -------
Subject: Bug 13714
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2004-02-05 19:45:47
Modified files:
gcc/cp : ChangeLog typeck.c
Log message:
PR c++/13714
* typeck.c (lookup_destructor): Tweak error message.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3939&r2=1.3940
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.525&r2=1.526
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13714
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/13714] [3.4/3.5 Regression] destructor name `const s' does not match type `const s' of expression
2004-01-16 21:49 [Bug c++/13714] New: destructor name `const s' does not match type `const s' of expression marcus at jet dot franken dot de
` (9 preceding siblings ...)
2004-02-05 19:45 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-05 19:46 ` mmitchel at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-02-05 19:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-02-05 19:46 -------
Fixed in GCC 3.4
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13714
^ permalink raw reply [flat|nested] 12+ messages in thread