Diagnose declarations of conversion functions with declarators other than '()'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101098 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/conversion-function.cpp b/test/SemaCXX/conversion-function.cpp
index 381cd60..972409c 100644
--- a/test/SemaCXX/conversion-function.cpp
+++ b/test/SemaCXX/conversion-function.cpp
@@ -165,3 +165,14 @@
 
   E2<int&> e2i; // expected-note{{in instantiation}}
 }
+
+namespace crazy_declarators {
+  struct A {
+    (&operator bool())(); // expected-error {{must use a typedef to declare a conversion to 'bool (&)()'}}
+
+    // FIXME: This diagnostic is misleading (the correct spelling
+    // would be 'operator int*'), but it's a corner case of a
+    // rarely-used syntax extension.
+    *operator int();  // expected-error {{must use a typedef to declare a conversion to 'int *'}}
+  };
+}