[PATCH] D21767: Fix instantiation of friend function templates

2018-08-14 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Oh, I see. The code currently tries to work with just the specialization and the pattern. To do the instantiation, we have to find template arguments for the context in which the pattern appears. For function temploids that aren't defined in a friend declaration, we

[PATCH] D21767: Fix instantiation of friend function templates

2018-08-14 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In https://reviews.llvm.org/D21767#1197783, @rjmccall wrote: > Shouldn't there just be a link in the AST from the instantiated > `FunctionTemplateDecl ` back to the original pattern? Maybe a generalization > of `InstantiatedFromMember` in `RedeclarablableTemplateDecl

[PATCH] D21767: Fix instantiation of friend function templates

2018-08-13 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Shouldn't there just be a link in the AST from the instantiated `FunctionTemplateDecl ` back to the original pattern? Maybe a generalization of `InstantiatedFromMember` in `RedeclarablableTemplateDecl`? Repository: rC Clang https://reviews.llvm.org/D21767 _

[PATCH] D21767: Fix instantiation of friend function templates

2018-08-12 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 160290. sepavloff added a comment. Rebased the patch, it is still actual. Repository: rC Clang https://reviews.llvm.org/D21767 Files: include/clang/AST/ASTLambda.h include/clang/AST/Decl.h include/clang/Sema/Sema.h lib/AST/Decl.cpp lib/Sema/S

[PATCH] D21767: Fix instantiation of friend function templates

2018-03-25 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 139758. sepavloff added a comment. Rebased patch Repository: rC Clang https://reviews.llvm.org/D21767 Files: include/clang/AST/ASTLambda.h include/clang/AST/Decl.h include/clang/Sema/Sema.h lib/AST/Decl.cpp lib/Sema/SemaTemplateInstantiate.cp

[PATCH] D21767: Fix instantiation of friend function templates

2017-09-25 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 116484. sepavloff edited the summary of this revision. sepavloff added a comment. Added regression test for PR34343 Investigation of this defect is presented in https://bugs.llvm.org/show_bug.cgi?id=34343 . https://reviews.llvm.org/D21767 Files: inclu

[PATCH] D21767: Fix instantiation of friend function templates

2017-07-23 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 107817. sepavloff added a comment. Reworked patch Used more general way to cope with calculation of instantiation stack, which is suitable for cases represented in PR26512. Added new tests. https://reviews.llvm.org/D21767 Files: include/clang/AST/ASTL

[PATCH] D21767: Fix instantiation of friend function templates

2017-07-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 106914. sepavloff added a comment. Aligned implementation with https://reviews.llvm.org/D21508. https://reviews.llvm.org/D21767 Files: lib/AST/Decl.cpp lib/Sema/SemaTemplateInstantiate.cpp test/SemaTemplate/instantiate-friend-function.cpp Index: te

[PATCH] D21767: Fix instantiation of friend function templates

2016-06-27 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a reviewer: rsmith. sepavloff added a subscriber: cfe-commits. If a function template was defined in a friend declaration in a template class, it was not instantiated because template definition was not found. http://reviews.llvm.org/D21767 Files: