summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/conversion-function.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-04-13 00:04:31 +0000
committerJohn McCall <rjmccall@apple.com>2010-04-13 00:04:31 +0000
commit212fa2efb7009ef94e314cefcc87d7facedabf6a (patch)
tree9734b5fbe53feffe71d9fee1d1a97134ebf2aa50 /clang/test/SemaCXX/conversion-function.cpp
parent5dbefc6697fbaaeb11a0143454112976de993831 (diff)
downloadbcm5719-llvm-212fa2efb7009ef94e314cefcc87d7facedabf6a.tar.gz
bcm5719-llvm-212fa2efb7009ef94e314cefcc87d7facedabf6a.zip
Diagnose declarations of conversion functions with declarators other than '()'.
llvm-svn: 101098
Diffstat (limited to 'clang/test/SemaCXX/conversion-function.cpp')
-rw-r--r--clang/test/SemaCXX/conversion-function.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/conversion-function.cpp b/clang/test/SemaCXX/conversion-function.cpp
index 381cd60d40a..972409ca5a3 100644
--- a/clang/test/SemaCXX/conversion-function.cpp
+++ b/clang/test/SemaCXX/conversion-function.cpp
@@ -165,3 +165,14 @@ namespace source_locations {
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 *'}}
+ };
+}
OpenPOWER on IntegriCloud