]> granicus.if.org Git - clang/commitdiff
Add test coverage for invalid conversion functions with default args.
authorNico Weber <nicolasweber@gmx.de>
Sat, 10 May 2014 19:15:24 +0000 (19:15 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 10 May 2014 19:15:24 +0000 (19:15 +0000)
This currently leaks memory (PR19689) but wasn't covered by tests, so LSan
couldn't find it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208477 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/conversion-function.cpp

index 1d5700df98aeb40563d34bdaed26725863df63f6..dcc0609b587c93ede403b52ce79c997773e40e6c 100644 (file)
@@ -26,6 +26,9 @@ class Y {
 public:
   void operator bool(int, ...) const; // expected-error{{conversion function cannot have a return type}} \
   // expected-error{{conversion function cannot have any parameters}}
+
+  operator bool(int a = 4) const; // expected-error{{conversion function cannot have any parameters}}
+  
   
   operator float(...) const;  // expected-error{{conversion function cannot be variadic}}