c++.beta - DMC++ 8.45.5
- Walter Bright (3/3) Sep 05 2005 Fixes W這dzimierz Skiba's 1) and 2) problems.
- W這dzimierz Skiba (46/49) Sep 06 2005 Thanks, I can indeed confirm it fixed 1) and 2). As for the case 3) here...
- Walter Bright (12/22) Sep 06 2005 preserved also
- W這dzimierz Skiba (8/18) Sep 07 2005 Sorry for that, it exists in my own copy so it must be that my clipboard...
- W這dzimierz Skiba (4/6) Sep 07 2005 BTW: Comeau online in strict mode doesn't report any ambiguity.
- Walter Bright (3/8) Sep 07 2005 Which one does it pick?
- W這dzimierz Skiba (9/12) Sep 07 2005 Sorry, I'm not sure I understand your question...
- Walter Bright (7/12) Sep 07 2005 news:dfnd7a$qhg$2@digitaldaemon.com:
- W這dzimierz Skiba (6/13) Sep 08 2005 I don't think I can check this with Comeau online :(
- Walter Bright (7/19) Sep 08 2005 news:dfnspm$19ks$2@digitaldaemon.com:
- Walter Bright (5/8) Sep 07 2005 compilers.
- W這dzimierz Skiba (4/14) Sep 07 2005 No, it is not important or no, it shouldn't be accessed ?
- Walter Bright (3/16) Sep 07 2005 I meant that member access is irrelevant to overload resolution.
- W這dzimierz Skiba (27/30) Sep 06 2005 Now case 4) It happens in method wxFileCtrl::SetWild of file:
- Walter Bright (12/40) Sep 06 2005 news:dfiikl$2mis$1@digitaldaemon.com:
- W這dzimierz Skiba (21/26) Sep 07 2005 That leads me nowhere :-(
- Walter Bright (27/34) Sep 07 2005 your
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
"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.htmlThanks, 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
"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 Ipreserved alsocomment which exists in wxWidgets sources in case it could put some lightwhat wasthe 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
"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
"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
"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:Which one does it pick?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.
Sep 07 2005
"Walter Bright" <newshound digitalmars.com> wrote in news:dfnd7a$qhg$2 digitaldaemon.com: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. ABXBTW: Comeau online in strict mode doesn't report any ambiguity.Which one does it pick?
Sep 07 2005
"W這dzimierz Skiba" <abx abx.art.pl> wrote in message news:dfne0h$pkn$2 digitaldaemon.com..."Walter Bright" <newshound digitalmars.com> wrote innews:dfnd7a$qhg$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&)Sorry, I'm not sure I understand your question...BTW: Comeau online in strict mode doesn't report any ambiguity.Which one does it pick?
Sep 07 2005
"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
"W這dzimierz Skiba" <abx abx.art.pl> wrote in message news:dfoqh3$25jl$1 digitaldaemon.com..."Walter Bright" <newshound digitalmars.com> wrote innews:dfnspm$19ks$2 digitaldaemon.com:apeared inI 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 codeApril. I will forward this thread to the author of the original code tocheck if hehas 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
"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 othercompilers.So perhaps... is that important that testString(int) is _private_ ? Can itbeaccessed in assignemnt outside testString class?No, member access is checked for only after method selection.
Sep 07 2005
"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...No, it is not important or no, it shouldn't be accessed ? ABXI know that it is poor prove that it is not ambigous for all othercompilers.So perhaps... is that important that testString(int) is _private_ ? Can itbeaccessed in assignemnt outside testString class?No, member access is checked for only after method selection.
Sep 07 2005
"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:I meant that member access is irrelevant to overload resolution."Wlodzimierz Skiba" <abx abx.art.pl> wrote in message news:dfm9gi$2q8j$1 digitaldaemon.com...No, it is not important or no, it shouldn't be accessed ?I know that it is poor prove that it is not ambigous for all othercompilers.So perhaps... is that important that testString(int) is _private_ ? Can itbeaccessed in assignemnt outside testString class?No, member access is checked for only after method selection.
Sep 07 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.htmlNow 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
"W這dzimierz Skiba" <abx abx.art.pl> wrote in message news:dfk1gi$qco$1 digitaldaemon.com..."Walter Bright" <newshound digitalmars.com> wrote innews:dfiikl$2mis$1 digitaldaemon.com:http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/src/generic/filedlgg.cpp?anno tate=1.143Fixes W?odzimierz Skiba's 1) and 2) problems. http://ftp.digitalmars.com/Digital_Mars_C++/Patch/beta.zip http://www.digitalmars.com/download/freecompiler.htmlNow case 4) It happens in method wxFileCtrl::SetWild of file: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 sameinternalerror 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
"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
"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 followyourscenario. My access to the net is limited to follow immediatelly youranswers so ifyou want to duplicate this problem yourself I have packaged this cpp filetogetherwith all non DMC headers and together with bat script which containscommand linetaken from wxWidgets makefile modified to this independent package. Thiszip stillcaused 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