www.digitalmars.com         C & C++   DMDScript  

c++.beta - DMC++ 8.45.5

reply "Walter Bright" <newshound digitalmars.com> writes:
Fixes W這dzimierz Skiba's 1) and 2) problems.

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

http://www.digitalmars.com/download/freecompiler.html
Sep 05 2005
next sibling parent reply "W這dzimierz Skiba" <abx abx.art.pl> writes:
"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
Sep 06 2005
parent reply "Walter Bright" <newshound digitalmars.com> writes:
"W這dzimierz 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.
Sep 06 2005
parent reply "W這dzimierz Skiba" <abx abx.art.pl> writes:
"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
Sep 07 2005
next sibling parent reply "W這dzimierz Skiba" <abx abx.art.pl> writes:
"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
Sep 07 2005
parent reply "Walter Bright" <newshound digitalmars.com> writes:
"W這dzimierz 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?
Sep 07 2005
parent reply "W這dzimierz Skiba" <abx abx.art.pl> writes:
"Walter Bright" <newshound digitalmars.com> wrote in
news:dfnd7a$qhg$2 digitaldaemon.com:
 BTW: Comeau online in strict mode doesn't report any ambiguity.
Which one does it pick?
Sorry, I'm not sure I understand your question... I meant that all: Open Watcom, GCC of MinGW, Borland and VC silently accepted original wxWidgets code and once I striped it down (as posted earlier + public ctor testString() as mentioned) Comeau Online C++ compiled my minimal sample without error. Only DMC 8.45.5 reported "Error: ambiguous reference to symbol". I will be now off-line until tomorrow so I just hope it clarifies things for your investigation. ABX
Sep 07 2005
parent reply "Walter Bright" <newshound digitalmars.com> writes:
"W這dzimierz Skiba" <abx abx.art.pl> wrote in message
news:dfne0h$pkn$2 digitaldaemon.com...
 "Walter Bright" <newshound digitalmars.com> wrote in
news:dfnd7a$qhg$2 digitaldaemon.com:
 BTW: Comeau online in strict mode doesn't report any ambiguity.
Which one does it pick?
Sorry, I'm not sure I understand your question...
I meant which of the following conversion sequences does it pick: testRegKey => operator bool => testString(int) or: testRegKey => operator testString => testString(const testString&)
Sep 07 2005
parent reply "W這dzimierz Skiba" <abx abx.art.pl> writes:
"Walter Bright" <newshound digitalmars.com> wrote in
news:dfnspm$19ks$2 digitaldaemon.com:
 I meant which of the following conversion sequences does it pick:
 
     testRegKey => operator bool => testString(int)
 
 or:
 
     testRegKey => operator testString => testString(const testString&)
I don't think I can check this with Comeau online :( The expected behaviour was operator testString since when this code apeared in April. I will forward this thread to the author of the original code to check if he has any additional info to add. ABX
Sep 08 2005
parent "Walter Bright" <newshound digitalmars.com> writes:
"W這dzimierz Skiba" <abx abx.art.pl> wrote in message
news:dfoqh3$25jl$1 digitaldaemon.com...
 "Walter Bright" <newshound digitalmars.com> wrote in
news:dfnspm$19ks$2 digitaldaemon.com:
 I meant which of the following conversion sequences does it pick:

     testRegKey => operator bool => testString(int)

 or:

     testRegKey => operator testString => testString(const testString&)
I don't think I can check this with Comeau online :( The expected behaviour was operator testString since when this code
apeared in
 April. I will forward this thread to the author of the original code to
check if he
 has any additional info to add.
I've adjusted the compiler so it picks operator testString. I'll post a new beta shortly. The internal error is fixed, too.
Sep 08 2005
prev sibling parent reply "Walter Bright" <newshound digitalmars.com> writes:
"W這dzimierz 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.
Sep 07 2005
parent reply "W這dzimierz Skiba" <abx abx.art.pl> writes:
"Walter Bright" <newshound digitalmars.com> wrote in
news:dfnd79$qhg$1 digitaldaemon.com: 
 "Wlodzimierz 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.
No, it is not important or no, it shouldn't be accessed ? ABX
Sep 07 2005
parent "Walter Bright" <newshound digitalmars.com> writes:
"W這dzimierz Skiba" <abx abx.art.pl> wrote in message
news:dfndla$pkn$1 digitaldaemon.com...
 "Walter Bright" <newshound digitalmars.com> wrote in
 news:dfnd79$qhg$1 digitaldaemon.com:
 "Wlodzimierz 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.
No, it is not important or no, it shouldn't be accessed ?
I meant that member access is irrelevant to overload resolution.
Sep 07 2005
prev sibling parent reply "W這dzimierz Skiba" <abx abx.art.pl> writes:
"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
Sep 06 2005
parent reply "Walter Bright" <newshound digitalmars.com> writes:
"W這dzimierz 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!
Sep 06 2005
parent reply "W這dzimierz Skiba" <abx abx.art.pl> writes:
"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
Sep 07 2005
parent "Walter Bright" <newshound digitalmars.com> writes:
"W這dzimierz Skiba" <abx abx.art.pl> wrote in message
news:dfmjo5$2g3$1 digitaldaemon.com...
 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)
Ok, I have that one solved now. Just for entertainment value, the minimal test case to reproduce it turned out to be: struct wxObject { virtual ~wxObject() { } }; struct wxListItemAttr { wxObject m_colText, m_colBack; ~wxListItemAttr() { } }; struct wxListItem { ~wxListItem() { delete m_attr; } wxListItemAttr *m_attr; }; void UpdateFiles() { wxListItem item; }
Sep 07 2005