aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/conversion-function.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-04-16 17:51:27 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-04-16 17:51:27 +0000
commit3201f6beec688ab9fe8750527e28f52d5420e22d (patch)
treeee806d81273e190e494239c9db4b4b57fafc24e4 /test/SemaCXX/conversion-function.cpp
parentba79fc2d1b742e34df104aadb2780725c2a882fc (diff)
Fix a crash bug when comparing overload quality of conversion operators with conversion constructors.
Remove an atrocious amount of trailing whitespace in the overloaded operator mangler. Sorry, couldn't help myself. Change the DeclType parameter of Sema::CheckReferenceInit to be passed by value instead of reference. It wasn't changed anywhere. Let the parser handle C++'s irregular grammar around assignment-expression and conditional-expression. And finally, the reason for all this stuff: implement C++ semantics for the conditional operator. The implementation is complete except for determining lvalueness. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69299 91177308-0d34-0410-b5e6-96231b3b80d8
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 b5dca080d4..1ecea89aab 100644
--- a/test/SemaCXX/conversion-function.cpp
+++ b/test/SemaCXX/conversion-function.cpp
@@ -50,3 +50,14 @@ public:
operator const void() const; // expected-warning{{conversion function converting 'class B' to 'void const' will never be used}}
operator const B(); // expected-warning{{conversion function converting 'class B' to itself will never be used}}
};
+
+// This used to crash Clang.
+struct Flip;
+struct Flop {
+ Flop();
+ Flop(const Flip&);
+};
+struct Flip {
+ operator Flop() const;
+};
+Flop flop = Flip(); // expected-error {{cannot initialize 'flop' with an rvalue of type 'struct Flip'}}