c++/3560: Problem with template enum

Xavier.Decoret@imag.fr Xavier.Decoret@imag.fr
Wed Jul 4 08:46:00 GMT 2001


>Number:         3560
>Category:       c++
>Synopsis:       Problem with template enum
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 04 08:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Xavier Decoret
>Release:        gcc version 3.0
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
when compiled, the attached file gives:

main.C:7: invalid use of undefined type `enum Foo<T>::Exceptions'
main.C:6: forward declaration of `enum Foo<T>::Exceptions'

If you remove the template argument (which is actually unused)
then it compiles.
>How-To-Repeat:
template <class T>
class Foo
{
public:
  enum Exceptions { A,B,C };
  void foo() throw(Exceptions)
    {
    }
};

int main()
{
  return 0;
}
>Fix:
dunnot know :-)
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="main.C"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="main.C"

CnRlbXBsYXRlIDxjbGFzcyBUPgpjbGFzcyBGb28KewpwdWJsaWM6CiAgZW51bSBFeGNlcHRpb25z
IHsgQSxCLEMgfTsKICB2b2lkIGZvbygpIHRocm93KEV4Y2VwdGlvbnMpCiAgICB7CiAgICB9Cn07
CgppbnQgbWFpbigpCnsKICByZXR1cm4gMDsKfQo=



More information about the Gcc-bugs mailing list