aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/typo-correction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/typo-correction.cpp')
-rw-r--r--test/SemaCXX/typo-correction.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/SemaCXX/typo-correction.cpp b/test/SemaCXX/typo-correction.cpp
new file mode 100644
index 0000000000..adf317b8b9
--- /dev/null
+++ b/test/SemaCXX/typo-correction.cpp
@@ -0,0 +1,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));
+}