Indiana Unversity logo[ConceptGCC]

ConceptGCC :

Compiler Bug?!

From: Bonderer Rolf (rolfbo_at_[hidden])
Date: 2006-06-25 03:02:07


Dear all,

I came across a problem when working with conceptGCC. While tracking down the error I came up with the following simple program:

#include <concepts>

concept A<typename S, typename T>
{
  typename typeA = S::typeS;
};

concept B<typename T>
{
  typename typeB = T::typeT;
};

concept C<typename S, typename T>
: A<S,T>, B<T>
{};

template <typename S, typename T>
where C<S,T>
void test(S ss, T tt) {}

class s { public: typedef double typeS; };
class t { public: typedef double typeT; };

concept_map C<s,t> {}

int main() {
  s ss; t tt;
  test(ss,tt);
}

//end of program

The error message is:
test.cpp: In function ‘int main()’:
test.cpp:28: error: no matching function for call to ‘test(s&, t&)’
test.cpp:19: note: candidates are: void test(S, T) [with S = s, T = t] <where clause>
test.cpp:28: error: invalid use of undefined type ‘concept B<s>’
test.cpp:8: error: declaration of ‘concept B<s>’
test.cpp:28: note: same-type constraint ‘std::SameType<typename B<S>::typeB, typename B<T>::typeB>’ is not satisfied (‘<type error>’ is not ‘double’)

I do not understand why it even uses a ‘concept B<s>’. Is there possibly a compiler bug?! Or can anyone see a problem in my program?

Thank you for your support.

Kind regards,
Rolf Bonderer