diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index c5fb98dbcb..db7d94dba6 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -203,7 +203,8 @@ std::string PredefinedExpr::ComputeName(ASTContext &Context, IdentType IT, } Proto += ")"; - AFT->getResultType().getAsStringInternal(Proto, Policy); + if (!isa(FD) && !isa(FD)) + AFT->getResultType().getAsStringInternal(Proto, Policy); Out << Proto; diff --git a/test/CodeGenCXX/predefined-expr.cpp b/test/CodeGenCXX/predefined-expr.cpp index 95bc255bdd..45b4e9f540 100644 --- a/test/CodeGenCXX/predefined-expr.cpp +++ b/test/CodeGenCXX/predefined-expr.cpp @@ -12,12 +12,12 @@ // CHECK: private constant [38 x i8] c"void NS::Base::functionTemplate1(int)\00" // CHECK: private constant [12 x i8] c"~Destructor\00" -// CHECK: private constant [35 x i8] c"void NS::Destructor::~Destructor()\00" +// CHECK: private constant [30 x i8] c"NS::Destructor::~Destructor()\00" // CHECK: private constant [12 x i8] c"Constructor\00" -// CHECK: private constant [46 x i8] c"void NS::Constructor::Constructor(NS::Base *)\00" -// CHECK: private constant [39 x i8] c"void NS::Constructor::Constructor(int)\00" -// CHECK: private constant [36 x i8] c"void NS::Constructor::Constructor()\00" +// CHECK: private constant [41 x i8] c"NS::Constructor::Constructor(NS::Base *)\00" +// CHECK: private constant [34 x i8] c"NS::Constructor::Constructor(int)\00" +// CHECK: private constant [31 x i8] c"NS::Constructor::Constructor()\00" // CHECK: private constant [16 x i8] c"virtualFunction\00" // CHECK: private constant [44 x i8] c"virtual void NS::Derived::virtualFunction()\00"