You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2011/03/06 00:39:45 UTC

[jira] Updated: (STDCXX-178) [Sun C++ 5.8 patch 121017-01] bogus ambiguity on a const member overload

     [ https://issues.apache.org/jira/browse/STDCXX-178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor updated STDCXX-178:
--------------------------------

    Description: 
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

{noformat}
$ 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.
{noformat}

  was:
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.



Corrected formatting.

> [Sun C++ 5.8 patch 121017-01] bogus ambiguity on a const member overload
> ------------------------------------------------------------------------
>
>                 Key: STDCXX-178
>                 URL: https://issues.apache.org/jira/browse/STDCXX-178
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: External
>    Affects Versions: 4.1.3
>         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
> {noformat}
> $ 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.
> {noformat}

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira