File tree Expand file tree Collapse file tree
tests/multi-file/out_of_line_methods_cross_tu Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1226,6 +1226,15 @@ bool Converter::VisitNamespaceDecl(clang::NamespaceDecl *decl) {
12261226 return false ;
12271227}
12281228
1229+ bool Converter::VisitLinkageSpecDecl (clang::LinkageSpecDecl *decl) {
1230+ for (auto *child : decl->decls ()) {
1231+ if (IsInMainFile (child) || !decl_ids_.contains (GetID (child))) {
1232+ Convert (child);
1233+ }
1234+ }
1235+ return false ;
1236+ }
1237+
12291238bool Converter::VisitTypedefDecl ([[maybe_unused]] clang::TypedefDecl *decl) {
12301239 return false ;
12311240}
Original file line number Diff line number Diff line change @@ -173,6 +173,8 @@ class Converter : public clang::RecursiveASTVisitor<Converter> {
173173
174174 virtual bool VisitNamespaceDecl (clang::NamespaceDecl *decl);
175175
176+ bool VisitLinkageSpecDecl (clang::LinkageSpecDecl *decl);
177+
176178 virtual bool VisitTypedefDecl (clang::TypedefDecl *decl);
177179 virtual bool VisitTypeAliasDecl (clang::TypeAliasDecl *decl);
178180 virtual bool VisitTypeAliasTemplateDecl (clang::TypeAliasTemplateDecl *decl);
@@ -488,6 +490,11 @@ class Converter : public clang::RecursiveASTVisitor<Converter> {
488490
489491 virtual bool VisitClassTemplateDecl (clang::ClassTemplateDecl *decl);
490492
493+ bool TraverseClassTemplateSpecializationDecl (
494+ clang::ClassTemplateSpecializationDecl *) {
495+ return true ;
496+ }
497+
491498 virtual bool
492499 VisitCXXStdInitializerListExpr (clang::CXXStdInitializerListExpr *expr);
493500
Original file line number Diff line number Diff line change @@ -12,5 +12,9 @@ int main() {
1212 Derived derived (3 );
1313 Base *base = &derived;
1414 assert (base->apply (5 ) == 15 );
15+
16+ Pair pair{7 , 3 };
17+ assert (pair_sum (&pair) == 10 );
18+ assert (pair_diff (&pair) == 4 );
1519 return 0 ;
1620}
Original file line number Diff line number Diff line change @@ -14,3 +14,5 @@ int S::add(int x) {
1414Derived::Derived (int factor) : factor(factor) {}
1515
1616int Derived::apply (int x) { return factor * x; }
17+
18+ int pair_sum (const struct Pair *p) { return p->first + p->second ; }
Original file line number Diff line number Diff line change @@ -26,3 +26,14 @@ class Derived : public Base {
2626
2727 int factor;
2828};
29+
30+ extern " C" {
31+ struct Pair {
32+ int first;
33+ int second;
34+ };
35+
36+ int pair_sum (const struct Pair *p);
37+
38+ inline int pair_diff (const struct Pair *p) { return p->first - p->second ; }
39+ }
You can’t perform that action at this time.
0 commit comments