[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-03 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. martong marked an inline comment as done. Closed by commit rG1e14588d0f68: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs (authored by martong).

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Looks good with a minor cleanup. Thanks! Comment at: clang/lib/Sema/SemaTemplate.cpp:2081-2085 TypeLocBuilder InnerTLB; QualType Transformed =

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added a comment. In D92101#2428104 , @martong wrote: > In D92101#2423685 , @shafik wrote: > >> Should we add a test for the `regular function template` case as well? > > I think this issue is specific for a

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D92101#2423685 , @shafik wrote: > Should we add a test for the `regular function template` case as well? I think this issue is specific for a `CXXDeductionGuideDecl` which is a `FunctionDecl`. I am not sure if I can follow

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @rsmith I have moved the check into `TransformTypedefType`. We do not add the typedef to the `MaterializedTypedefs` list if it's context is dependent because later we set the deduction guide as the DC for all typedefs in the list: for (auto *TD :

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 308922. martong added a comment. - Add to MaterializedTypedefs only when copying the Decl Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92101/new/ https://reviews.llvm.org/D92101 Files:

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 308920. martong added a comment. - Move dependent context check into TransformTypedefType - Add new test case for param with pointer type Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92101/new/

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D92101#2423685 , @shafik wrote: > Should we add a test for the `regular function template` case as well? I think this issue is specific for `CXXDeductionGuideDecl`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-11-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Sema/SemaTemplate.cpp:2077 QualType TransformTypedefType(TypeLocBuilder , TypedefTypeLoc TL) { ASTContext = SemaRef.getASTContext(); The check to see if we should clone a typedef or not should be

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-11-30 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added a comment. Should we add a test for the `regular function template` case as well? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92101/new/ https://reviews.llvm.org/D92101 ___ cfe-commits

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-11-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/Sema/SemaTemplate.cpp:2356-2359 + auto *CD = cast(OldParam->getDeclContext()); + // If the typedef is not a local typedef, then skip the transform. + if (OldTypedefDecl->getDeclContext() != CD->getDeclContext())

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-11-30 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 308335. martong marked 2 inline comments as done. martong added a comment. - Check for dependent DeclContext - Remove "dump()" calls from tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92101/new/

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-11-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Sema/SemaTemplate.cpp:2356-2359 + auto *CD = cast(OldParam->getDeclContext()); + // If the typedef is not a local typedef, then skip the transform. + if (OldTypedefDecl->getDeclContext() != CD->getDeclContext())

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-11-25 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/unittests/AST/ASTImporterTest.cpp:5906 + Lang_CXX17, "input.cc"); + TU->dump(); + auto *Guide = FirstDeclMatcher().match( These `dump` calls should be removed (in the other case too)? Repository: rG

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-11-25 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/unittests/AST/ASTImporterTest.cpp:5893 + // in the global scope. + EXPECT_EQ(Param->getType()->getAs()->getDecl(), Typedef); +} Note, this "expectation" fails in baseline. Repository: rG LLVM Github Monorepo

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-11-25 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added a reviewer: rsmith. Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp, rnkovacs. Herald added a reviewer: shafik. Herald added a project: clang. martong requested review of this revision.