[cfe-commits] r145551 - in /cfe/trunk: lib/AST/Decl.cpp test/Index/linkage.c
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Nov 30 17:28:21 PST 2011
Author: akirtzidis
Date: Wed Nov 30 19:28:21 2011
New Revision: 145551
URL: http://llvm.org/viewvc/llvm-project?rev=145551&view=rev
Log:
ParmVarDecls have no linkage. Previously we would report that parameters
in type signatures have external linkage.
Fixes rdar://10058317.
Modified:
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/test/Index/linkage.c
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=145551&r1=145550&r2=145551&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Wed Nov 30 19:28:21 2011
@@ -721,6 +721,8 @@
switch (D->getKind()) {
default:
break;
+ case Decl::ParmVar:
+ return LinkageInfo::none();
case Decl::TemplateTemplateParm: // count these as external
case Decl::NonTypeTemplateParm:
case Decl::ObjCAtDefsField:
Modified: cfe/trunk/test/Index/linkage.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/linkage.c?rev=145551&r1=145550&r2=145551&view=diff
==============================================================================
--- cfe/trunk/test/Index/linkage.c (original)
+++ cfe/trunk/test/Index/linkage.c Wed Nov 30 19:28:21 2011
@@ -11,6 +11,8 @@
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 @@
// 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
More information about the cfe-commits
mailing list