[ConceptGCC] |
ConceptGCC :Another possible exception bug. definition won't match declaration. |
From: Simon Hill (yacwroy_at_[hidden])
Date: 2008-09-13 03:43:34
I'm trying to define a template function declared with a concept
template parameter.
The function throws a specific template class defined with the above
concept template parameter.
I've tried simplifying it further, eg removing EFoo) but it compiles
successfully if I do.
Concept version. Doesn't compile.
====================================
auto concept Cept<typename A> {}
template <Cept A>
class AFoo {
public:
struct EFoo {};
};
template <typename T, Cept A>
inline T foo(A bar) throw(typename AFoo<A>::EFoo);
template <typename T, Cept A>
inline T foo(A bar) throw(typename AFoo<A>::EFoo) {}
int main() {}
====================================
cept_bug.cpp:13: error: declaration of 'template<class T, class A> T
foo(A) throw (AFoo<A'>::EFoo)' throws different exceptions
cept_bug.cpp:10: error: from previous declaration 'template<class T,
class A> T foo(A) throw (AFoo<A'>::EFoo)'
====================================
Note, the definition and declaration are identical.
Conceptless version. Does compile on both g++ & concept-g++.
====================================
template <typename A>
class AFoo {
public:
struct EFoo {};
};
template <typename T, typename A>
inline T foo(A bar) throw(typename AFoo<A>::EFoo);
template <typename T, typename A>
inline T foo(A bar) throw(typename AFoo<A>::EFoo) {}
int main() {}
====================================
Is this a bug?