Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-18 Thread Vassil Vassilev via cfe-commits
Š¢hanks, could you (or smb else with commit perms) check it in? --Vassil On 18/02/16 03:24, Richard Smith wrote: (And otherwise this LGTM.) On Wed, Feb 17, 2016 at 5:24 PM, Richard Smith wrote: + // TODO: Check visibility. New is hidden but has a complete type. If New + // has no arra

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-17 Thread Richard Smith via cfe-commits
+ // TODO: Check visibility. New is hidden but has a complete type. If New + // has no array bound, it should not inherit one from Old, if Old is not + // visible. I think this is in the wrong place: it should be attached to the "old is complete and new is not" case. Also, our conve

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-17 Thread Richard Smith via cfe-commits
(And otherwise this LGTM.) On Wed, Feb 17, 2016 at 5:24 PM, Richard Smith wrote: > + // TODO: Check visibility. New is hidden but has a complete type. If > New > + // has no array bound, it should not inherit one from Old, if Old is > not > + // visible. > > I think this is in th

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-17 Thread Vassil Vassilev via cfe-commits
On 16/02/16 22:20, Richard Smith wrote: --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -419,6 +419,25 @@ static bool isPreferredLookupResult(Sema &S, Sema::LookupNameKind Kind, } } + // VarDecl can have incomplete array types, prefer the one with more complete + /

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-16 Thread Richard Smith via cfe-commits
--- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -419,6 +419,25 @@ static bool isPreferredLookupResult(Sema &S, Sema::LookupNameKind Kind, } } + // VarDecl can have incomplete array types, prefer the one with more complete + // array type. + if (VarDecl *DVD = dyn_cast(DUn

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-16 Thread Vassil Vassilev via cfe-commits
ping... On 07/02/16 22:33, Vassil Vassilev wrote: Improve a comment. --Vassil On 07/02/16 20:48, Vassil Vassilev wrote: Would this patch be any better? --Vassil On 05/02/16 21:49, Richard Smith wrote: This belongs in ASTDeclReader::attachPreviousDecl[Impl]. That's where we propagate data that's

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-07 Thread Vassil Vassilev via cfe-commits
Improve a comment. --Vassil On 07/02/16 20:48, Vassil Vassilev wrote: Would this patch be any better? --Vassil On 05/02/16 21:49, Richard Smith wrote: This belongs in ASTDeclReader::attachPreviousDecl[Impl]. That's where we propagate data that's supposed to be consistent across a redeclaration

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-07 Thread Vassil Vassilev via cfe-commits
Would this patch be any better? --Vassil On 05/02/16 21:49, Richard Smith wrote: This belongs in ASTDeclReader::attachPreviousDecl[Impl]. That's where we propagate data that's supposed to be consistent across a redeclaration chain from earlier declarations to later ones. There's another wrinkl

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-05 Thread Richard Smith via cfe-commits
This belongs in ASTDeclReader::attachPreviousDecl[Impl]. That's where we propagate data that's supposed to be consistent across a redeclaration chain from earlier declarations to later ones. There's another wrinkle here: we should only be propagating the type from a previous declaration that's dec

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-05 Thread Vassil Vassilev via cfe-commits
I am not sure where else to put this logic if not in isSameEntity... Could you point me to a better place? --Vassil On 05/02/16 19:56, Richard Smith wrote: On Fri, Feb 5, 2016 at 7:04 AM, Vassil Vassilev mailto:v.g.vassi...@gmail.com>> wrote: Good point. Do you have in mind calling 'cl

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-05 Thread Richard Smith via cfe-commits
On Fri, Feb 5, 2016 at 7:04 AM, Vassil Vassilev wrote: > Good point. Do you have in mind calling 'clang::Sema::MergeVarDeclTypes' > or we to just "duplicate" the logic in > clang::ASTDeclReader::mergeRedeclarable? > It's not safe to call into Sema while we're in a partially-deserialized state. W

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-05 Thread Vassil Vassilev via cfe-commits
Good point. Do you have in mind calling 'clang::Sema::MergeVarDeclTypes' or we to just "duplicate" the logic in clang::ASTDeclReader::mergeRedeclarable? On 05/02/16 02:50, Richard Smith via cfe-commits wrote: I suspect we'll need to do a little more than this: when we rebuild the redeclaration

Re: r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-02-04 Thread Richard Smith via cfe-commits
I suspect we'll need to do a little more than this: when we rebuild the redeclaration chain, we should probably propagate the complete type to later redeclarations in the same scope. Otherwise, if we import a module that has a complete type and one that has an incomplete type, the declaration found

r258524 - Merge templated static member variables, fixes http://llvm.org/pr26179.

2016-01-22 Thread Yaron Keren via cfe-commits
Author: yrnkrn Date: Fri Jan 22 13:03:27 2016 New Revision: 258524 URL: http://llvm.org/viewvc/llvm-project?rev=258524&view=rev Log: Merge templated static member variables, fixes http://llvm.org/pr26179. Patch by Vassil Vassilev! Reviewed by Richard Smith. Added: cfe/trunk/test/Modules/Inp