diff options
author | John McCall <rjmccall@apple.com> | 2010-05-17 23:56:34 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-05-17 23:56:34 +0000 |
commit | 532ec7baf2d0791abc9551ef856a537711c5774a (patch) | |
tree | 88248b31d2c0ad2b14fdbe6bcf9a51f8e940f68d | |
parent | 00e9cbb13d3e5deb8ee27288e0ed816266ec9e5b (diff) |
Teach the ObjC mangler to ignore member pointers just like gcc does.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104001 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AST/ASTContext.cpp | 5 | ||||
-rw-r--r-- | test/CodeGenObjCXX/encode.mm | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index cd567a6142..11b4546e37 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -3715,6 +3715,11 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, return; } + // gcc just blithely ignores member pointers. + // TODO: maybe there should be a mangling for these + if (T->getAs<MemberPointerType>()) + return; + assert(0 && "@encode for type not implemented!"); } diff --git a/test/CodeGenObjCXX/encode.mm b/test/CodeGenObjCXX/encode.mm index 9dfd14db05..4f472caa9c 100644 --- a/test/CodeGenObjCXX/encode.mm +++ b/test/CodeGenObjCXX/encode.mm @@ -2,7 +2,7 @@ // CHECK: v17@0:8{vector<float, float, float>=}16 // CHECK: {vector<float, float, float>=} - +// CHECK: v24@0:816 template <typename T1, typename T2, typename T3> struct vector { vector(T1,T2,T3); @@ -37,3 +37,15 @@ typedef vector< float, float, float > vector3f; [sn setPosition:VF3]; } @end + + +class Int3 { int x, y, z; }; + +// Enforce @encoding for member pointers. +@interface MemPtr {} +- (void) foo: (int (Int3::*)) member; +@end +@implementation MemPtr +- (void) foo: (int (Int3::*)) member { +} +@end |