Douglas Gregor | 025291b | 2010-07-01 00:21:21 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | // <rdar://problem/8124080> |
| 4 | template<typename _Alloc> class allocator; |
| 5 | template<class _CharT> struct char_traits; |
| 6 | template<typename _CharT, typename _Traits = char_traits<_CharT>, |
| 7 | typename _Alloc = allocator<_CharT> > |
| 8 | class basic_string; |
| 9 | template<typename _CharT, typename _Traits, typename _Alloc> |
| 10 | const typename basic_string<_CharT, _Traits, _Alloc>::size_type |
| 11 | basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_max_size // expected-error{{no member named '_Rep' in 'basic_string<_CharT, _Traits, _Alloc>'}} |
| 12 | = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4; |
| 13 | |
| 14 | // PR7118 |
| 15 | template<typename T> |
| 16 | class Foo { |
| 17 | class Bar; |
| 18 | void f() { |
| 19 | Bar i; |
| 20 | } |
| 21 | }; |
Argyrios Kyrtzidis | 6a622df | 2010-10-30 01:06:23 +0000 | [diff] [blame] | 22 | |
| 23 | // PR7625 |
| 24 | template<typename T> struct a : T { |
| 25 | struct x : T { |
| 26 | int aa() { return p; } // expected-error{{use of undeclared identifier 'p'}} |
| 27 | }; |
| 28 | }; |
Argyrios Kyrtzidis | d86132d | 2010-10-30 01:06:26 +0000 | [diff] [blame] | 29 | |
| 30 | // rdar://8605381 |
| 31 | namespace rdar8605381 { |
| 32 | struct X {}; |
| 33 | |
| 34 | struct Y { // expected-note{{candidate}} |
| 35 | Y(); |
| 36 | }; |
| 37 | |
| 38 | struct { |
| 39 | Y obj; |
| 40 | } objs[] = { |
| 41 | new Y // expected-error{{no viable conversion}} |
| 42 | }; |
| 43 | } |
Argyrios Kyrtzidis | 2c4792c | 2010-11-05 23:25:18 +0000 | [diff] [blame^] | 44 | |
| 45 | // http://llvm.org/PR8234 |
| 46 | namespace PR8234 { |
| 47 | template<typename Signature> |
| 48 | class callback |
| 49 | { |
| 50 | }; |
| 51 | |
| 52 | template<typename R , typename ARG_TYPE0> |
| 53 | class callback<R( ARG_TYPE0)> |
| 54 | { |
| 55 | public: |
| 56 | callback() {} |
| 57 | }; |
| 58 | |
| 59 | template< typename ARG_TYPE0> |
| 60 | class callback<void( ARG_TYPE0)> |
| 61 | { |
| 62 | public: |
| 63 | callback() {} |
| 64 | }; |
| 65 | |
| 66 | void f() |
| 67 | { |
| 68 | callback<void(const int&)> op; |
| 69 | } |
| 70 | } |