Indiana Unversity logo[ConceptGCC]

ConceptGCC :

function throw requirements

From: Simon Hill (yacwroy_at_[hidden])
Date: 2008-09-07 11:36:30


I was trying to create a concept requiring a function to be declared
as throws nothing. However, ConceptGCC concepts seem to accept
mismatched throw clauses in functions.

=====================
This compiles, but should it?
=====================
auto concept XFoo<typename T> {
   void T::bar() throw();
};

template <XFoo T>
class CBam {};

class CZug {
 public:
   void bar() throw(int) {} // this version of bar() doesn't match
that in XFoo. Removing this line causes compilation error.
};

int main() {

   CBam<CZug> a; // CZug shouldn't be an XFoo since their bar()
thrown exceptions don't match. So IMHO this shouldn't compile.

   return 0;
}
=====================

Are concepts supposed to ignore function throw requirements?
Or is this something that is coming to ConceptGCC, but isn't yet implemented?
Or this a bug with ConceptGCC?

Thanks.