blob: adf317b8b95f00af18e01e0aeba1a3ad6786555d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-c++0x-extensions %s
struct errc {
int v_;
operator int() const {return v_;}
};
class error_condition
{
int _val_;
public:
error_condition() : _val_(0) {}
error_condition(int _val)
: _val_(_val) {}
template <class E>
error_condition(E _e)
{*this = make_error_condition(_e);}
};
inline error_condition make_error_condition(errc _e) {
return error_condition(static_cast<int>(_e));
}
|