diff options
author | Vassil Vassilev <v.g.vassilev@gmail.com> | 2017-07-01 20:44:49 +0000 |
---|---|---|
committer | Vassil Vassilev <v.g.vassilev@gmail.com> | 2017-07-01 20:44:49 +0000 |
commit | b00ea08fda0842452c166538d057cd194ff3b0f6 (patch) | |
tree | 25555d303113ddd7f1b1a23a1f404bc01d444f86 /clang/lib/AST/Decl.cpp | |
parent | 94fce50950533255147278dc151bf1720ae07c29 (diff) | |
download | bcm5719-llvm-b00ea08fda0842452c166538d057cd194ff3b0f6.tar.gz bcm5719-llvm-b00ea08fda0842452c166538d057cd194ff3b0f6.zip |
[modules] Teach clang how to merge typedef over anonymous structs in C mode.
In C mode clang fails to merge the textually included definition with the one imported from a module. The C lookup rules fail to find the imported definition because its linkage is internal in non C++ mode.
This patch reinstates some of the ODR merging rules for typedefs of anonymous tags for languages other than C++.
Patch by Raphael Isemann and me (D34510).
llvm-svn: 306964
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 267c6992af8..24d99839125 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -1259,8 +1259,7 @@ static LinkageInfo computeLVForDecl(const NamedDecl *D, case Decl::TypeAlias: // A typedef declaration has linkage if it gives a type a name for // linkage purposes. - if (!D->getASTContext().getLangOpts().CPlusPlus || - !cast<TypedefNameDecl>(D) + if (!cast<TypedefNameDecl>(D) ->getAnonDeclWithTypedefName(/*AnyRedecl*/true)) return LinkageInfo::none(); break; |