Douglas Gregor | 5112157 | 2010-03-24 01:33:17 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | // PR6619 |
| 4 | template<bool C> struct if_c { }; |
| 5 | template<typename T1> struct if_ { |
| 6 | typedef if_c< static_cast<bool>(T1::value)> almost_type_; // expected-note 7{{in instantiation}} |
| 7 | }; |
| 8 | template <class Model, void (Model::*)()> struct wrap_constraints { }; |
| 9 | template <class Model> |
| 10 | inline char has_constraints_(Model* , // expected-note 4{{while substituting}} \ |
| 11 | // expected-note 3{{candidate template ignored}} |
| 12 | wrap_constraints<Model,&Model::constraints>* = 0); // expected-note 4{{in instantiation}} |
| 13 | |
| 14 | template <class Model> struct not_satisfied { |
| 15 | static const bool value = sizeof( has_constraints_((Model*)0) == 1); // expected-error 3{{no matching function}} |
| 16 | }; |
| 17 | template <class ModelFn> struct requirement_; |
| 18 | template <void(*)()> struct instantiate { |
| 19 | }; |
| 20 | template <class Model> struct requirement_<void(*)(Model)> : if_< not_satisfied<Model> >::type { // expected-error 3{{no type named}} \ |
| 21 | // expected-note 7{{in instantiation}} |
| 22 | }; |
| 23 | template <class Model> struct usage_requirements { |
| 24 | }; |
| 25 | template < typename TT > struct InputIterator { |
| 26 | typedef instantiate< & requirement_<void(*)(usage_requirements<InputIterator> x)>::failed> boost_concept_check1; // expected-note 2{{in instantiation}} |
| 27 | }; |
| 28 | template < typename TT > struct ForwardIterator : InputIterator<TT> { // expected-note 2{{in instantiation}} |
| 29 | typedef instantiate< & requirement_<void(*)(usage_requirements<ForwardIterator> x)>::failed> boost_concept_check2; // expected-note 2 {{in instantiation}} |
| 30 | |
| 31 | }; |
| 32 | typedef instantiate< &requirement_<void(*)(ForwardIterator<char*> x)>::failed> boost_concept_checkX; // expected-error{{no member named}} \ |
| 33 | // expected-note 6{{in instantiation}} |