Jump to page: 1 2
Thread overview
DMC++ 8.45.5
Sep 05, 2005
Walter Bright
Sep 06, 2005
W³odzimierz Skiba
Sep 06, 2005
Walter Bright
Sep 07, 2005
W³odzimierz Skiba
Sep 07, 2005
W³odzimierz Skiba
Sep 07, 2005
Walter Bright
Sep 07, 2005
W³odzimierz Skiba
Sep 07, 2005
Walter Bright
Sep 08, 2005
W³odzimierz Skiba
Sep 08, 2005
Walter Bright
Sep 07, 2005
Walter Bright
Sep 07, 2005
W³odzimierz Skiba
Sep 07, 2005
Walter Bright
Sep 06, 2005
W³odzimierz Skiba
Sep 06, 2005
Walter Bright
Sep 07, 2005
W³odzimierz Skiba
Sep 07, 2005
Walter Bright
September 05, 2005
Fixes W³odzimierz Skiba's 1) and 2) problems.

http://ftp.digitalmars.com/Digital_Mars_C++/Patch/beta.zip

http://www.digitalmars.com/download/freecompiler.html




September 06, 2005
"Walter Bright" <newshound@digitalmars.com> wrote in news:dfiikl$2mis$1@digitaldaemon.com:
> Fixes W?odzimierz Skiba's 1) and 2) problems. http://ftp.digitalmars.com/Digital_Mars_C++/Patch/beta.zip http://www.digitalmars.com/download/freecompiler.html

Thanks, I can indeed confirm it fixed 1) and 2). As for the case 3) here is minimal sample I was able to extract with error message preserved (note I preserved also comment which exists in wxWidgets sources in case it could put some light what was the intention of class construction.

dmc test.cpp
    testString my_str = my_test;
                               ^
test.cpp(36) : Error: ambiguous reference to symbol
Had: testString::testString(int )
and: testString::testString(const testString&)


Below is source of test.cpp:

class testString
{
private:
    // if we hadn't made these operators private, it would be possible to
    // compile "wxString s; s = 17;" without any warnings as 17 is implicitly
    // converted to char in C and we do have operator=(char)
    //
    // NB: we don't need other versions (short/long and unsigned) as attempt
    //     to assign another numeric type to wxString will now result in
    //     ambiguity between operator=(char) and operator=(int)
    testString& operator=(int);

    // these methods are not implemented - there is _no_ conversion from int to
    // string, you're doing something wrong if the compiler wants to call it!
    testString(int);
public:
    testString& operator=(const char *psz) {return *this;}
};

class testRegKey
{
public:
    testRegKey(bool test) { m_test = test; m_str = ""; }
    ~testRegKey() {}
    operator bool()  const { return m_test; }
    operator testString() const { return m_str; }
private:
    bool m_test;
    testString m_str;
};

void test()
{
    testRegKey my_test(true);
    testString my_str = my_test;
}


ABX
September 06, 2005
"Walter Bright" <newshound@digitalmars.com> wrote in news:dfiikl$2mis$1@digitaldaemon.com:
> Fixes W?odzimierz Skiba's 1) and 2) problems. http://ftp.digitalmars.com/Digital_Mars_C++/Patch/beta.zip http://www.digitalmars.com/download/freecompiler.html

Now case 4) It happens in method wxFileCtrl::SetWild of file: http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/src/generic/filedlgg.cpp?annotate=1.143

    void wxFileCtrl::SetWild( const wxString &wild )
    {
        if (wild.Find(wxT('|')) != wxNOT_FOUND)
            return;
        m_wild = wild;
        UpdateFiles();
    }

I replaced its begining with:

    #pragma message "wxFileCtrl::SetWild"
    void wxFileCtrl::SetWild( const wxString &wild )
    #pragma message "0"

and the output is:

    wxFileCtrl::SetWild
    Internal error: eh 759
    --- errorlevel 1

so replaced its begining with:

    #pragma message "wxFileCtrl::SetWild"
    void
    #pragma message "0"
    wxFileCtrl::SetWild( const wxString &wild )

and the output was again the same. Then I disabled all the code _before_ wxFileCtrl::SetWild and compilation went fine but returned the same internal error two functions later. Hints for further testing?

ABX
September 06, 2005
"W³odzimierz Skiba" <abx@abx.art.pl> wrote in message news:dfjl59$gbv$1@digitaldaemon.com...
> As for the case 3) here is minimal
> sample I was able to extract with error message preserved (note I
preserved also
> comment which exists in wxWidgets sources in case it could put some light
what was
> the intention of class construction.
>
> dmc test.cpp
>     testString my_str = my_test;
>                                ^
> test.cpp(36) : Error: ambiguous reference to symbol
> Had: testString::testString(int )
> and: testString::testString(const testString&)

I had to add the constructor:
    testString();
to class testString to duplicate your results. But it does seem to be
ambiguous to me. We have my_str that needs to be constructed. There are two
paths to construction:

    testRegKey => operator bool => testString(int)
    testRegKey => operator testString => testString(const testString&)

They are of equal merit, so it is ambiguous.


September 06, 2005
"W³odzimierz Skiba" <abx@abx.art.pl> wrote in message news:dfk1gi$qco$1@digitaldaemon.com...
> "Walter Bright" <newshound@digitalmars.com> wrote in
news:dfiikl$2mis$1@digitaldaemon.com:
> > Fixes W?odzimierz Skiba's 1) and 2) problems. http://ftp.digitalmars.com/Digital_Mars_C++/Patch/beta.zip http://www.digitalmars.com/download/freecompiler.html
>
> Now case 4) It happens in method wxFileCtrl::SetWild of file:
>
http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/src/generic/filedlgg.cpp?anno tate=1.143
>
>     void wxFileCtrl::SetWild( const wxString &wild )
>     {
>         if (wild.Find(wxT('|')) != wxNOT_FOUND)
>             return;
>         m_wild = wild;
>         UpdateFiles();
>     }
>
> I replaced its begining with:
>
>     #pragma message "wxFileCtrl::SetWild"
>     void wxFileCtrl::SetWild( const wxString &wild )
>     #pragma message "0"
>
> and the output is:
>
>     wxFileCtrl::SetWild
>     Internal error: eh 759
>     --- errorlevel 1
>
> so replaced its begining with:
>
>     #pragma message "wxFileCtrl::SetWild"
>     void
>     #pragma message "0"
>     wxFileCtrl::SetWild( const wxString &wild )
>
> and the output was again the same. Then I disabled all the code _before_ wxFileCtrl::SetWild and compilation went fine but returned the same
internal
> error two functions later. Hints for further testing?

The #pragma message is not useful for finding out where an error happens. The best way to find these types of problems is to compile with the -e -l switches to create a .lst file. Rename the .lst file to test.cpp. Then create a cc.bat that compiles test.cpp and verify the problem is reproduced.

Now, do a 'binary search' on test.cpp by whacking away stuff and see if the error stays or goes away. Rinse, repeat, until a minimal test case is found!


September 07, 2005
"Walter Bright" <newshound@digitalmars.com> wrote in news:dfkgrb$1ami$1@digitaldaemon.com:
> I had to add the constructor:
>     testString();

Sorry for that, it exists in my own copy so it must be that my clipboard contained earlier copy of the test scource.

> But it does seem to be
> ambiguous to me. We have my_str that needs to be constructed. There
> are two paths to construction:
> 
>     testRegKey => operator bool => testString(int)
>     testRegKey => operator testString => testString(const testString&)
> 
> They are of equal merit, so it is ambiguous.

I know that it is poor prove that it is not ambigous for all other compilers. So perhaps... is that important that testString(int) is _private_ ? Can it be accessed in assignemnt outside testString class?

ABX
September 07, 2005
"Walter Bright" <newshound@digitalmars.com> wrote in news:dfkgrc$1ami$2@digitaldaemon.com:
> The #pragma message is not useful for finding out where an error happens. The best way to find these types of problems is to compile with the -e -l switches to create a .lst file. Rename the .lst file to test.cpp. Then create a cc.bat that compiles test.cpp and verify the problem is reproduced.

That leads me nowhere :-(

I added -e and -l at the end of command line. filedlgg.lst file was created but
we use precompiled headers and that lst file not included anything from those
headers. Moreover lst file was truncated enexpectedly after 2 KB of source (original
file had over 40 KB).

I then removed pch options from command line of dmc and forced dmc to include all the headers of dmc. This time lst file was created much longer (about 2.3 MB) and internal error was reported during creation of this lst file but again it is clearly truncated at some unexpected place. Runing dmc on that file results in:

  filedlgg.cpp(84431) : Error: ';' expected following declaration of struct member
  Fatal error: premature end of source file

So I have no idea how to duplicate that problem with lst file and follow your scenario. My access to the net is limited to follow immediatelly your answers so if you want to duplicate this problem yourself I have packaged this cpp file together with all non DMC headers and together with bat script which contains command line taken from wxWidgets makefile modified to this independent package. This zip still caused Internal error: eh 759.

http://www.abx.art.pl/wx/dmc_eh_759.zip (~440 KB)

ABX
September 07, 2005
"Wlodzimierz Skiba" <abx@abx.art.pl> wrote in news:dfm9gi$2q8j$1@digitaldaemon.com:

> I know that it is poor prove that it is not ambigous for all other compilers.

BTW: Comeau online in strict mode doesn't report any ambiguity.

ABX
September 07, 2005
"W³odzimierz Skiba" <abx@abx.art.pl> wrote in message news:dfm9gi$2q8j$1@digitaldaemon.com...
> I know that it is poor prove that it is not ambigous for all other
compilers.
> So perhaps... is that important that testString(int) is _private_ ? Can it
be
> accessed in assignemnt outside testString class?

No, member access is checked for only after method selection.


September 07, 2005
"W³odzimierz Skiba" <abx@abx.art.pl> wrote in message news:dfn3gp$h46$1@digitaldaemon.com...
> "Wlodzimierz Skiba" <abx@abx.art.pl> wrote in news:dfm9gi$2q8j$1@digitaldaemon.com:
>
> > I know that it is poor prove that it is not ambigous for all other compilers.
>
> BTW: Comeau online in strict mode doesn't report any ambiguity.

Which one does it pick?


« First   ‹ Prev
1 2