From mboxrd@z Thu Jan 1 00:00:00 1970 From: gdlxn@us.ibm.com To: gcc-gnats@gcc.gnu.org Subject: c++/2743: Compile error when exception in throw clause not qualified Date: Fri, 04 May 2001 15:06:00 -0000 Message-id: <20010504215628.3025.qmail@sourceware.cygnus.com> X-SW-Source: 2001-05/msg00146.html List-Id: >Number: 2743 >Category: c++ >Synopsis: Compile error when exception in throw clause not qualified >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Fri May 04 15:06:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: gdlxn@us.ibm.com >Release: gcc version 2.95.2 19991024 (release) >Organization: >Environment: SuSE Linux 7.0 for i386 >Description: Compiling the attached source (Test.cpp) with gcc -g -o Test Test.cpp produces the following error Test.cpp:18: parse error before `)' I can workaround the error by changing line 18 from ns::Test::Test() throw( Exception ) : i( 1 ) to ns::Test::Test() throw( ns::Exception ) : i( 1 ) It's not clear why I have to qualify exceptions in the throw clause of default constructors. I don't have to qualify exceptions in the throw clause of any other methods. For example, see line 22 in the sample source code. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/x-unknown-content-type-CppFile.Cpp; name="Test.cpp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Test.cpp" bmFtZXNwYWNlIG5zIHsKICBjbGFzcyBFeGNlcHRpb24KICB7CiAgfTsKfQoKbmFtZXNwYWNlIG5z CnsKICBjbGFzcyBUZXN0IHsKICAgIHB1YmxpYzoKICAgICAgaW5saW5lIFRlc3QoKSB0aHJvdygg RXhjZXB0aW9uICk7CiAgICAgIGlubGluZSBUZXN0KGludCBuICkgdGhyb3coIEV4Y2VwdGlvbiAp OwogICAgcHJpdmF0ZToKICAgICAgaW50IGk7CiAgfTsKfQoKbnM6OlRlc3Q6OlRlc3QoKSB0aHJv dyggRXhjZXB0aW9uICkgOiBpKCAxICkKewp9Cgpuczo6VGVzdDo6VGVzdCggaW50IG4gKSB0aHJv dyggRXhjZXB0aW9uICkgOiBpKCBuICkKewp9CgppbnQgbWFpbihpbnQgYXJnYywgY2hhciogYXJn dikgewogIG5zOjpUZXN0IHRlc3Q7Cn0K