diff options
-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 |