[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-10 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344157: [Sema] Fix a multiple definition bug with friends and templates (authored by epilk, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D53

[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-10 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. LGTM. https://reviews.llvm.org/D53046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/

[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 168939. erik.pilkington added a comment. Merge the common pointers rather than trying to use the previous one. Thanks! https://reviews.llvm.org/D53046 Files: clang/include/clang/AST/DeclTemplate.h clang/lib/AST/DeclTemplate.cpp clang/lib/Sema/

[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-09 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D53046#1259945, @erik.pilkington wrote: > In https://reviews.llvm.org/D53046#1259933, @rjmccall wrote: > > > The linking does actually happen in this test case, right? Can we just do > > something when linking them to unify their `Common` st

[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D53046#1259933, @rjmccall wrote: > The linking does actually happen in this test case, right? Can we just do > something when linking them to unify their `Common` structures? Yep, that would work too I think. We can't properly merge

[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-09 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. The linking does actually happen in this test case, right? Can we just do something when linking them to unify their `Common` structures? Repository: rC Clang https://reviews.llvm.org/D53046 ___ cfe-commits mailing lis

[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:10015 // merged. if (MergeFunctionDecl(NewFD, OldDecl, S, MergeTypeWithPrevious)) { NewFD->setInvalidDecl(); The problem is here, MergeFunctionDecl() needs the injecte

[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, rjmccall. Herald added a subscriber: dexonsmith. Clang used to error out on the attached testcase, due to multiple definitions of `foo`. The problem is that multiple FunctionTemplateDecl::Common pointers are created