This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: C++ bug 764
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Subject: Re: C++ bug 764
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 07 May 2001 13:09:32 +0200
- Cc: gcc-bugs at gcc dot gnu dot org, mark at codesourcery dot com, jason at redhat dot com, sebor at roguewave dot com
- Organization: CodeSourcery, LLC
- References: <3AF29153.935B582@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com> writes:
| Hi,
| In reexamining bug 764, I'm not convinced the code is well-formed.
Well, I think the code (the example you posted below) is well-formed
and the compiler is behaving in a non-conformant way.
| (Martin, we may have corresponded on this, but I cannot find any of
| that email).
|
| The code in question is this [note, that this is in a follow up, as the
| original bug report code wasn't what martin intended]
|
| template <class T>
| struct S
| {
| friend bool operator== (const S&, const S&) {
| return true;
| }
| };
|
| int main ()
| {
| // S<int> s;
|
| const S<int> *p = 0;
Right now, just instantiating the name declaration S<int> is sufficient.
| *p == *p; // error
At this point, we need to instantiate the class S<int> in order to
form the overload set. See 13.3.1.2/3.
| }
|
| g++ says,
|
| test.cpp: In function `int main()':
| test.cpp:33: no match for `const S<int> & == const S<int> &'
This is boggus.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com