public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21799] New: [4.1 regression] Spurious ambiguity with pointers to members
@ 2005-05-28 16:35 bangerth at dealii dot org
  2005-05-28 17:43 ` [Bug c++/21799] " bangerth at dealii dot org
                   ` (32 more replies)
  0 siblings, 33 replies; 35+ messages in thread
From: bangerth at dealii dot org @ 2005-05-28 16:35 UTC (permalink / raw)
  To: gcc-bugs

This 4.1 regression is going to break one of the proposed benchmarks in 
spec2005. I believe that we have established that this code 
----------------------------- 
template <class T> void f (T &,       void (T::*)()      ); 
template <class T> void f (const T &, void (T::*)() const); 
 
struct X { 
    void g() const; 
}; 
 
const X *x; 
 
int main () { 
  f (*x, &X::g); 
} 
-------------------------------- 
is valid because the pointer to the constant member &X::g can't match the 
first template (it wants a non-const pointer-to-member). The code is accepted 
by all previous gcc versions, but with present mainline I get this: 
spec/src> c++ -c x.cc 
x.cc: In function &#8216;int main()&#8217;: 
x.cc:11: error: call of overloaded &#8216;f(const X&, void (X::*)()const)&#8217; is 
ambiguous 
x.cc:1: note: candidates are: void f(T&, void (T::*)()) [with T = const X] 
x.cc:2: note:                 void f(const T&, void (T::*)()const) [with T = 
X] 
 
Too bad... 
 
W.

-- 
           Summary: [4.1 regression] Spurious ambiguity with pointers to
                    members
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-08-12  9:41 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-28 16:35 [Bug c++/21799] New: [4.1 regression] Spurious ambiguity with pointers to members bangerth at dealii dot org
2005-05-28 17:43 ` [Bug c++/21799] " bangerth at dealii dot org
2005-05-28 17:59 ` pinskia at gcc dot gnu dot org
2005-05-31 13:52 ` bangerth at dealii dot org
2005-05-31 14:05 ` bangerth at dealii dot org
2005-05-31 17:26 ` pinskia at gcc dot gnu dot org
2005-05-31 17:56 ` bangerth at dealii dot org
2005-06-20 21:30 ` bangerth at dealii dot org
2005-06-21  0:19 ` giovannibajo at libero dot it
2005-06-21 15:55 ` bangerth at dealii dot org
2005-06-21 16:00 ` bangerth at dealii dot org
2005-06-21 16:02 ` [Bug c++/21799] [4.0/4.1 " pinskia at gcc dot gnu dot org
2005-06-21 16:07 ` pinskia at gcc dot gnu dot org
2005-06-21 16:15 ` bangerth at dealii dot org
2005-06-21 20:43 ` bangerth at ices dot utexas dot edu
2005-06-21 20:45   ` Andrew Pinski
2005-06-21 20:45 ` pinskia at physics dot uc dot edu
2005-06-21 20:58 ` bangerth at dealii dot org
2005-06-22  1:24 ` giovannibajo at libero dot it
2005-06-23 14:51 ` bangerth at dealii dot org
2005-06-23 15:04 ` mark at codesourcery dot com
2005-06-23 15:08 ` bangerth at ices dot utexas dot edu
2005-06-23 15:20 ` mark at codesourcery dot com
2005-06-24 13:37 ` nathan at gcc dot gnu dot org
2005-06-24 15:53 ` nathan at gcc dot gnu dot org
2005-06-24 16:03 ` bangerth at ices dot utexas dot edu
2005-06-24 16:14 ` bangerth at ices dot utexas dot edu
2005-06-26  0:45 ` mark at codesourcery dot com
2005-07-06 17:02 ` mmitchel at gcc dot gnu dot org
2005-07-08 11:06 ` cvs-commit at gcc dot gnu dot org
2005-07-08 11:08 ` nathan at gcc dot gnu dot org
2005-07-11 11:02 ` reichelt at gcc dot gnu dot org
2005-08-12  9:24 ` [Bug c++/21799] [4.0 " cvs-commit at gcc dot gnu dot org
2005-08-12  9:36 ` nathan at gcc dot gnu dot org
2005-08-12  9:41 ` cvs-commit 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).