aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/conversion-function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/conversion-function.cpp')
-rw-r--r--test/SemaCXX/conversion-function.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaCXX/conversion-function.cpp b/test/SemaCXX/conversion-function.cpp
index 1ca1e689ea..cde2851bf3 100644
--- a/test/SemaCXX/conversion-function.cpp
+++ b/test/SemaCXX/conversion-function.cpp
@@ -64,3 +64,14 @@ struct Flip {
operator Flop() const;
};
Flop flop = Flip(); // expected-error {{cannot initialize 'flop' with an rvalue of type 'struct Flip'}}
+
+// This tests that we don't add the second conversion declaration to the list of user conversions
+struct C {
+ operator const char *() const;
+};
+
+C::operator const char*() const { return 0; }
+
+void f(const C& c) {
+ const char* v = c;
+}