This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/7224: g++ 3.x does not tecognize unused ambiguous inline member functions
- From: aaron at isotton dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 6 Jul 2002 18:45:58 -0000
- Subject: c++/7224: g++ 3.x does not tecognize unused ambiguous inline member functions
- Reply-to: aaron at isotton dot com
>Number: 7224
>Category: c++
>Synopsis: g++ 3.x does not tecognize unused ambiguous inline member functions
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Sat Jul 06 11:56:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Aaron Isotton
>Release: gcc version 3.1.1 20020606 (Debian prerelease)
>Organization:
>Environment:
i686 Linux 2.5.25
>Description:
The following code compiles:
struct foo
{
void bar() {}
int bar() {return 0;}
};
int main() {}
It should generate an error as two functions differing only in their return value are not permitted.
If the functions are not declared inline (i.e. outside the class) the assembler complains because the two functions have the same name; if the functions are used, a proper error message is emitted.
The same happens with g++ 3.0; g++ 2.95 recognizes the problem and emits an error message.
>How-To-Repeat:
Compile this snippet with no compiler flags:
struct foo
{
void bar() {
}
int bar() {
return 0;
}
};
int main() {}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: