stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-178) Sun C++ 5.8 patch 121017-01 bogus ambiguity on a const member overload
Date Fri, 12 May 2006 20:16:09 GMT
Sun C++ 5.8 patch 121017-01 bogus ambiguity on a const member overload
----------------------------------------------------------------------

         Key: STDCXX-178
         URL: http://issues.apache.org/jira/browse/STDCXX-178
     Project: C++ Standard Library
        Type: Bug

  Components: External  
 Environment: Sun C++ 5.8 Patch 121017-01 2005/12/11
    Reporter: Martin Sebor
    Priority: Minor


Test case for a problem apparently newly introduced in this patch. The vanilla 5.8 has no
problems with the code. This bug is the cause of the compilation errors discussed in the following
thread:
http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-user/200602.mbox/%3c20060214162358.34245.qmail@web82210.mail.mud.yahoo.com%3e

$ cat t.C && CC -V t.C
template <class T>
struct A {
    typedef T* P;
    template <class U> struct AA { typedef A<U> AU; };
};

template <class T>
struct B {
    typedef typename T::template AA <B>::AU TB;
    typedef typename TB::P                  BP;

    BP bp [1];
};

template <class T, class V>
struct C {
    typedef typename B<V>::BP B;

    void foobar (B) { }
    void foobar (const B) const { }

    B bp;

    C () { foobar (bp->bp [0]); }
} ;

int main ()
{
    C <char, A<int> > c;
}
CC: Sun C++ 5.8 Patch 121017-01 2005/12/11
ccfe: Sun C++ 5.8 Patch 121017-01 2005/12/11
"t.C", line 24: Error: Overloading ambiguity between "C<char, A<int>>::foobar(B<A<int>>*)"
and "C<char, A<int>>::foobar(B<A<int>>*const) const".
"t.C", line 29:     Where: While instantiating "C<char, A<int>>::C()".
"t.C", line 29:     Where: Instantiated from non-template code.
1 Error(s) detected.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message