Argyrios Kyrtzidis | 34f52d1 | 2011-04-22 01:18:40 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | // Don't crash. |
| 4 | |
| 5 | template<typename,typename=int,typename=int>struct basic_string; |
| 6 | |
| 7 | typedef basic_string<char> string; |
| 8 | |
| 9 | |
| 10 | |
| 11 | template<typename aT,typename,typename oc> |
| 12 | struct basic_string |
| 13 | { |
| 14 | int us; |
| 15 | basic_string(const aT*,const oc&a=int()); |
| 16 | |
| 17 | int _S_construct(); |
| 18 | |
| 19 | int _S_construct(int); |
| 20 | |
| 21 | _S_construct(); // expected-error {{requires}} |
| 22 | }; |
| 23 | |
| 24 | template<typename _CharT,typename _Traits,typename _Alloc> |
| 25 | basic_string<_CharT,_Traits,_Alloc>::basic_string(const _CharT*,const _Alloc&) |
| 26 | :us(_S_construct) |
| 27 | {string a;} |
| 28 | |
Eli Friedman | e9ee382 | 2012-02-22 04:49:04 +0000 | [diff] [blame] | 29 | struct runtime_error{runtime_error(string);}; |
Argyrios Kyrtzidis | 34f52d1 | 2011-04-22 01:18:40 +0000 | [diff] [blame] | 30 | |
Eli Friedman | e9ee382 | 2012-02-22 04:49:04 +0000 | [diff] [blame] | 31 | struct system_error:runtime_error{ // expected-note {{to match}} |
| 32 | system_error():time_error("" // expected-error 3 {{expected}} expected-note {{to match}} |