public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/2743: Compile error when exception in throw clause not qualified
@ 2001-05-04 15:06 gdlxn
  0 siblings, 0 replies; only message in thread
From: gdlxn @ 2001-05-04 15:06 UTC (permalink / raw)
  To: gcc-gnats

>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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-04 15:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-04 15:06 c++/2743: Compile error when exception in throw clause not qualified gdlxn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).