diff options
author | Peter Szecsi <szepet95@gmail.com> | 2018-04-25 17:28:03 +0000 |
---|---|---|
committer | Peter Szecsi <szepet95@gmail.com> | 2018-04-25 17:28:03 +0000 |
commit | b180eebed4239e45822b6d20f97241583bdc054b (patch) | |
tree | c34b42ccbb9c901ab278304421abf7541d4bf10d /clang/test/ASTMerge/class/Inputs/class2.cpp | |
parent | cd8688a4c26540c4d03e5f1ac6566e7cd29bddc5 (diff) | |
download | bcm5719-llvm-b180eebed4239e45822b6d20f97241583bdc054b.tar.gz bcm5719-llvm-b180eebed4239e45822b6d20f97241583bdc054b.zip |
[ASTImporter] FriendDecl importing improvements
There are only a few cases of importing a frienddecl which is currently supported.
This patch aims to improve the friend import process.
Set FriendObjectKind in case of decls, insert friend into the friend chain
correctly, checks structurally equivalent in a more advanced manner.
Test cases added as well.
llvm-svn: 330847
Diffstat (limited to 'clang/test/ASTMerge/class/Inputs/class2.cpp')
-rw-r--r-- | clang/test/ASTMerge/class/Inputs/class2.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/ASTMerge/class/Inputs/class2.cpp b/clang/test/ASTMerge/class/Inputs/class2.cpp index 2bed6d775bc..6fe38b92066 100644 --- a/clang/test/ASTMerge/class/Inputs/class2.cpp +++ b/clang/test/ASTMerge/class/Inputs/class2.cpp @@ -12,3 +12,29 @@ enum E { a = 0, b = 1 }; + +//Friend import tests +void f(); +int g(int a); +struct X; +struct Y; + +struct F1 { +public: + int x; + friend struct X; + friend int g(int); + friend void f(); +}; + +struct F2 { +public: + int x; + friend struct X; +}; + +struct F3 { +public: + int x; + friend void f(); +}; |