diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 7be4d26f98..5c7c0694a0 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -721,6 +721,8 @@ static LinkageInfo getLVForDecl(const NamedDecl *D, LVFlags Flags) { switch (D->getKind()) { default: break; + case Decl::ParmVar: + return LinkageInfo::none(); case Decl::TemplateTemplateParm: // count these as external case Decl::NonTypeTemplateParm: case Decl::ObjCAtDefsField: diff --git a/test/Index/linkage.c b/test/Index/linkage.c index d1f1c5bca5..41a1fbdd71 100644 --- a/test/Index/linkage.c +++ b/test/Index/linkage.c @@ -11,6 +11,8 @@ void bar(int y) { extern int n; static int wibble(int); +void ena(int (*dio)(int tria)); + // CHECK: EnumDecl=Baz:3:6 (Definition)linkage=External // CHECK: EnumConstantDecl=Qux:3:12 (Definition)linkage=External // CHECK: VarDecl=x:4:5linkage=External @@ -22,5 +24,7 @@ static int wibble(int); // CHECK: VarDecl=k:9:7 (Definition)linkage=NoLinkage // CHECK: VarDecl=n:11:12linkage=External // CHECK: FunctionDecl=wibble:12:12linkage=Internal -// CHECL: ParmDecl=:12:22 (Definition)linkage=NoLinkage - +// CHECK: ParmDecl=:12:22 (Definition)linkage=NoLinkage +// CHECK: FunctionDecl=ena:14:6linkage=External +// CHECK: ParmDecl=dio:14:16 (Definition)linkage=NoLinkage +// CHECK: ParmDecl=tria:14:25 (Definition)linkage=NoLinkage