diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-12 18:26:03 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-12 18:26:03 +0000 |
commit | b394f50ac90a38aee6e5daf6ff6cd80afed79726 (patch) | |
tree | 2ce278ceaab398ceae0f232d0ca88b2b6a53d875 /clang/test/SemaCXX/conversion-delete-expr.cpp | |
parent | f68f63b7cf146e753a8ffcf03017d94779232793 (diff) | |
download | bcm5719-llvm-b394f50ac90a38aee6e5daf6ff6cd80afed79726.tar.gz bcm5719-llvm-b394f50ac90a38aee6e5daf6ff6cd80afed79726.zip |
More work toward having an access method for visible
conversion functions.
llvm-svn: 81618
Diffstat (limited to 'clang/test/SemaCXX/conversion-delete-expr.cpp')
-rw-r--r-- | clang/test/SemaCXX/conversion-delete-expr.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/conversion-delete-expr.cpp b/clang/test/SemaCXX/conversion-delete-expr.cpp index bb79fea39f1..0a591a285be 100644 --- a/clang/test/SemaCXX/conversion-delete-expr.cpp +++ b/clang/test/SemaCXX/conversion-delete-expr.cpp @@ -43,7 +43,6 @@ void f2 (D2 d) } // Test4 - struct B3 { operator const int *(); }; @@ -69,7 +68,6 @@ struct X { void f4(X x) { delete x; delete x; } // Test6 - struct X1 { operator int(); operator int*(); @@ -78,6 +76,36 @@ struct X1 { void f5(X1 x) { delete x; } // FIXME. May have to issue error here too. +// Test7 +struct Base { + operator int*(); +}; + +struct Derived : Base { + operator int*() const; // not the same function as Base's non-const operator int() +}; + +void foo6(const Derived cd) { + // FIXME. overload resolution must select Derived::operator int*() const; + delete cd; // expected-error {{cannot delete expression of type 'struct Derived const'}} +} + +// Test8 +struct BB { + template<typename T> operator T*() const; +}; + +struct DD : BB { + template<typename T> operator T*() const; // hides base conversion + operator int *() const; +}; + +void foo7 (DD d) +{ + // FIXME. We select DD::operator int *() const; g++ issues ambiguity error. Investigate. + delete d; +} + |