[PATCH] D50994: Add a new flag and attributes to control static destructor registration

2018-08-21 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Sure, done in 340311! Repository: rC Clang https://reviews.llvm.org/D50994 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50994: Add a new flag and attributes to control static destructor registration

2018-08-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/AST/Decl.h:1472 + /// Do we need to emit an exit-time destructor for this variable? + bool isNoDestroy(const ASTContext &) const; jfb wrote: > rsmith wrote: > > jfb wrote: > > > This is on

[PATCH] D50994: Add a new flag and attributes to control static destructor registration

2018-08-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 161594. erik.pilkington marked 7 inline comments as done. erik.pilkington added a comment. In this new patch: - Fix some grammar errors in the documentation. - Add a testcase for both attributes appearing on a variable. - Just use hasArg() in the driv

[PATCH] D50527: [Parser] Support alternative operator token keyword args in Objective-C++

2018-08-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D50527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50994: Add a new flag and attributes to control static destructor registration

2018-08-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: jfb, rsmith, aaron.ballman, rjmccall, bruno. Herald added a subscriber: dexonsmith. See the recent thread here: http://lists.llvm.org/pipermail/cfe-dev/2018-July/058494.html This patch adds the flag -fno-c++-static-destructo

[PATCH] D48896: [libcxx][c++17] P0083R5: Splicing Maps and Sets Part 2: merge

2018-08-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D48896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50527: [Parser] Support alternative operator token keyword args in Objective-C++

2018-08-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. The build came back clean! https://reviews.llvm.org/D50527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50527: [Parser] Support alternative operator token keyword args in Objective-C++

2018-08-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D50527#1194660, @rjmccall wrote: > Assuming you've done enough source-compatibility testing to say with > reasonable confidence that this won't break anything, I think this is fine. > It's a core goal of Objective-C/C++ to allow the

[PATCH] D50527: [Parser] Support alternative operator token keyword args in Objective-C++

2018-08-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 159995. erik.pilkington added a comment. Remove `isBinaryCXXAlternativeOperatorToken`, this check can be done using `OpToken.getAsIdentifierInfo()`. Thanks! FWIW, I can't imagine this being anything but an oversight, we go out of our way to support

[PATCH] D50527: [Parser] Support alternative operator token keyword args in Objective-C++

2018-08-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rjmccall, arphaman. Herald added a subscriber: dexonsmith. This fixes rdar://30741878 Thanks! Erik Repository: rC Clang https://reviews.llvm.org/D50527 Files: clang/lib/Parse/ParseExpr.cpp clang/test/Parser/message-

[PATCH] D50122: Complex Variable defined in InitCapture Crash fix

2018-08-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaTemplateInstantiate.cpp:2916-2918 + if (const VarDecl *VD = dyn_cast(D)) +if (VD->isInitCapture()) + return nullptr; Why are we failing to find the instantiation of the VarDecl in this case

[PATCH] D50418: [Sema] Support for P0961R1: Relaxing the structured bindings customization point finding rules

2018-08-07 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:1118-1130 +// ... and if that finds at least one declaration that is a function +// template whose first template parameter is a non-type parameter ... +LookupResult::Filter Filter =

[PATCH] D50418: [Sema] Support for P0961R1: Relaxing the structured bindings customization point finding rules

2018-08-07 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 159629. erik.pilkington added a comment. Address review comments. https://reviews.llvm.org/D50418 Files: clang/lib/Sema/SemaDeclCXX.cpp clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp clang/www/cxx_status.html Index: clang/www/cxx_status.html =

[PATCH] D50418: [Sema] Support for P0961R1: Relaxing the structured bindings customization point finding rules

2018-08-07 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: rsmith. Herald added a subscriber: dexonsmith. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0961r1.html I don't believe an actual defect report was filed for this, but the paper (in the "wording" section) claims

[PATCH] D48896: [libcxx][c++17] P0083R5: Splicing Maps and Sets Part 2: merge

2018-08-07 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D48896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50088: [Sema] Fix an error with C++17 auto non-type template parameters

2018-08-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 159449. erik.pilkington retitled this revision from "[Sema] Dig through AutoTypes that have been deduced to an undeduced AutoType in Type::isUndeducedType" to "[Sema] Fix an error with C++17 auto non-type template parameters". erik.pilkington edited t

[PATCH] D50269: [compiler-rt][builtins] Don't #include CoreFoundation in os_version_check.c

2018-08-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: arphaman. Herald added subscribers: Sanitizers, llvm-commits, dexonsmith, dberris. This breaks some configurations, so just forward declare everything that we need. rdar://35943793 Thanks for taking a look! Erik Reposito

[PATCH] D50122: Complex Variable defined in InitCapture Crash fix

2018-07-31 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi Balaji, Can you try to manually reduce the attached testcase? Its really difficult to understand exactly what is actually happening here, and why your fix is correct, without having a minimal reproducer. Ideally there would just be a few decls that succinctly

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-07-31 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D46845#1183435, @mclow.lists wrote: > One more thing - > When you add a new header file, you need to update > `include/module.modulemap`, `test/libcxx/double_include.sh.cpp`, and > `include/CMakeLists.txt`. > Take a look at https:/

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-07-31 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D46845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50088: [Sema] Dig through AutoTypes that have been deduced to an undeduced AutoType in Type::isUndeducedType

2018-07-31 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: rsmith. Herald added a subscriber: dexonsmith. Clang used to error out on the attached test case because we deduced an auto type to an undeduced auto type in the template-id G. This caused Sema::CheckNonTypeTemplateParamete

[PATCH] D49952: Check for NULL Destination-Type when creating ArrayConstant

2018-07-27 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: test/CodeGenCXX/empty-struct-init-list.cpp:1-4 +// RUN: %clang_cc1 -std=c++11 %s +// RUN: %clang_cc1 -std=c++14 %s +// RUN: %clang_cc1 -std=c++17 %s +// expected-no-diagnostics You should add -emit-llvm, or el

[PATCH] D49766: Fix a crash when an error occurs in Template and the initializer is a nullptr for C++17

2018-07-27 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM, thanks! Do you have your commit rights yet? Comment at: include/clang/AST/TemplateBase.h:469 + +// Allow more additional argument kinds for the co

[PATCH] D49868: [Sema] Fix a crash by completing a type before using it

2018-07-26 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 157575. erik.pilkington added a comment. Add the testcase @rjmccall requested. https://reviews.llvm.org/D49868 Files: clang/lib/Sema/SemaInit.cpp clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp Index: clang/test/SemaCXX/cxx1z-cl

[PATCH] D49868: [Sema] Fix a crash by completing a type before using it

2018-07-26 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, rjmccall. Herald added a subscriber: dexonsmith. Only apply this exception on a type that we're able to check. Thanks! Erik Repository: rC Clang https://reviews.llvm.org/D49868 Files: clang/lib/Sema/SemaInit.c

[PATCH] D49766: Fix a crash when an error occurs in Template and the initializer is a nullptr for C++17

2018-07-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi Balaji, I reduced your testcase a bit more, this looks like the can be a crash on valid. Can you use the more minimal version in the testcase? template struct e { e(a) {} }; e c(0); Also: you should add cfe-commits as a subscriber when creatin

[PATCH] D49439: [Sema] Fix a crash while converting constructors to deduction guides

2018-07-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 157309. erik.pilkington added a comment. Implement @rsmith's second suggestion. Thanks! https://reviews.llvm.org/D49439 Files: clang/lib/Sema/SemaTemplate.cpp clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp Index: clang/test/Sema

[PATCH] D49439: [Sema] Fix a crash while converting constructors to deduction guides

2018-07-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Sema/SemaTemplate.cpp:1899-1907 // Canonicalize the type. This (for instance) replaces references to // typedef members of the current instantiations with the definitions of // those typedefs, avoiding tr

[PATCH] D48896: [libcxx][c++17] P0083R5: Splicing Maps and Sets Part 2: merge

2018-07-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 156912. erik.pilkington added a comment. In this new patch: - Rebase on top of changes in https://reviews.llvm.org/D46845 - Move in some forward decls that I accidentally left in https://reviews.llvm.org/D46845 - Add some missing visibility attribute

[PATCH] D49688: [Sema] Fix a crash when a BlockExpr appears in a default-member-initializer of a class template

2018-07-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D49688#1172269, @rjmccall wrote: > I honestly don't know why the `BlockDecl` is in the members list in the first > place; that seems wrong, for the same reason that we wouldn't (I assume?) > consider a lambda's implicit record to be a

[PATCH] D49688: [Sema] Fix a crash when a BlockExpr appears in a default-member-initializer of a class template

2018-07-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. (Forgot to add rdar://41200624) Repository: rC Clang https://reviews.llvm.org/D49688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D49688: [Sema] Fix a crash when a BlockExpr appears in a default-member-initializer of a class template

2018-07-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rjmccall, rsmith. Herald added a subscriber: dexonsmith. Previously, clang would crash here: template struct S { int (^p)() = ^{ return 0; }; }; S x; The problem was that InstantiateClass() was iterating over all

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-07-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D46845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-07-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a reviewer: aaron.ballman. erik.pilkington added a comment. Thanks for working on this! CCing Aaron, who is code owner for attributes. Comment at: include/clang/Basic/AttrDocs.td:3355 + let Content = [{ +The ``noderef`` attribute allows for showing a warn

[PATCH] D49085: [Sema] Emit a diagnostic for an invalid dependent function template specialization

2018-07-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:4111 + "candidate template ignored: %select{template is not a function template" + "|is not a member of the enclosing namespace}0">; rjmccall wrote: > Your fir

[PATCH] D49085: [Sema] Emit a diagnostic for an invalid dependent function template specialization

2018-07-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 156338. erik.pilkington added a comment. Improve the diagnostics further. https://reviews.llvm.org/D49085 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaTemplate.cpp clang/test/CXX/temp/temp.decls/temp.friend/p1.cpp

[PATCH] D49085: [Sema] Emit a diagnostic for an invalid dependent function template specialization

2018-07-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 156317. erik.pilkington added a comment. Improve the diagnostics. Thanks! https://reviews.llvm.org/D49085 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaTemplate.cpp clang/test/CXX/temp/temp.decls/temp.friend/p1.cpp

[PATCH] D49112: [Sema] Implement -Wmemset-transposed-args

2018-07-18 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:7984 + if (isa(ThirdArg) && + cast(ThirdArg)->getValue() == 0) { +WarningKind = 0; Quuxplusone wrote: > > Suppress the diagnostic in cases like `memset(ptr, 0xff, PADDING

[PATCH] D49112: [Sema] Implement -Wmemset-transposed-args

2018-07-18 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 156178. erik.pilkington marked 5 inline comments as done. erik.pilkington added a comment. This revision is now accepted and ready to land. In this new patch: - Add support for __builtin_bzero (-Wsuspicious-bzero), improve diagnostics for platforms t

[PATCH] D49439: [Sema] Fix a crash while converting constructors to deduction guides

2018-07-17 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: rsmith. Herald added a reviewer: javed.absar. Herald added subscribers: dexonsmith, kristof.beyls. The problem was with constructors that have parameters that refer to previous ones, such as `D` below: template struct A

[PATCH] D49112: [Sema] Implement -Wmemset-transposed-args

2018-07-17 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington planned changes to this revision. erik.pilkington added a comment. In https://reviews.llvm.org/D49112#1158793, @thakis wrote: > lgtm assuming you ran this on some large code base to make sure it doesn't > have false positives. Sorry for the delay here, I was running this on som

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-07-12 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: libcxx/include/__hash_table:2165 +#if _LIBCPP_STD_VER > 14 +template +template ldionne wrote: > When a function is declared with a visibility macro > (`_LIBCPP_INLINE_VISIBILITY` in this case), I think it is c

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-07-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a reviewer: ldionne. erik.pilkington added a comment. Ping! https://reviews.llvm.org/D46845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D49112: [Sema] Implement -Wmemset-transposed-args

2018-07-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:662 +def note_suspicious_sizeof_memset_silence : Note< + "%select{parenthesize the third argument|cast the second argument to 'int'}0 to silence">; + Quuxplusone

[PATCH] D49112: [Sema] Implement -Wmemset-transposed-args

2018-07-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 154833. erik.pilkington added a comment. Address @Quuxplusone comments. https://reviews.llvm.org/D49112 Files: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaChecking.cpp cla

[PATCH] D49112: [Sema] Implement -Wmemset-transposed-args

2018-07-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, aaron.ballman, arphaman. Herald added a subscriber: dexonsmith. This warning tries to catch programs that incorrectly call memset with the second and third arguments transposed, ie `memset(ary, sizeof(ary), 0)` instea

[PATCH] D48506: Fix for Crash in nested name specifier decltype

2018-07-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a subscriber: rtrieu. erik.pilkington added a comment. Looks like @rtrieu beat you to the punch in r336475! Presumably thats why the test case wasn't failing on TOT. Since this is already fixed, you should mark this revision as abandoned. Repository: rC Clang https://r

[PATCH] D48506: Fix for Crash in nested name specifier decltype

2018-07-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi Balaji, thanks for working on this! Comment at: lib/Sema/SemaCXXScopeSpec.cpp:849-850 QualType T = BuildDecltypeType(DS.getRepAsExpr(), DS.getTypeSpecTypeLoc()); + if (T.getTypePtrOrNull() == nullptr) + return true; if (!T->isDepe

[PATCH] D49085: [Sema] Emit a diagnostic for an invalid dependent function template specialization

2018-07-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rjmccall, rsmith. Herald added a subscriber: dexonsmith. Previously, clang marked a decl as invalid without emitting a diagnostic. This lead to an assert in CodeGen for the attached test case. rdar://41806724 Thanks for tak

[PATCH] D48896: [libcxx][c++17] P0083R5: Splicing Maps and Sets Part 2: merge

2018-07-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: EricWF, mclow.lists. Herald added subscribers: dexonsmith, ldionne, christof. This was originally part of https://reviews.llvm.org/D46845, but I decided to split it out to clean up the diff. From that patch's description: >

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-07-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 153964. erik.pilkington added a comment. Herald added a subscriber: dexonsmith. Split this up. I'm moving the `merge` stuff to a follow-up, that makes this diff a lot easier to read. https://reviews.llvm.org/D46845 Files: libcxx/include/__hash_ta

[PATCH] D48322: [Sema] Discarded statment should be an evaluatable context

2018-07-02 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D48322#1148424, @rsmith wrote: > Hmm, so this will mean that we can have internal linkage declarations marked > `Used` for which there is no definition, and we need to not warn on that. > > I think it might be better to avoid marking t

[PATCH] D48322: [Sema] Discarded statment should be an evaluatable context

2018-06-29 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Herald added a subscriber: dexonsmith. Ping! Repository: rC Clang https://reviews.llvm.org/D48322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D48342: [libcxx] Optimize vectors construction of trivial types from an iterator range with const-ness mismatch.

2018-06-27 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: libcxx/include/memory:1479 +struct __has_construct_missing +: false_type +{ vsapsai wrote: > erik.pilkington wrote: > > Shouldn't this be true_type? > I see this is confusing and I'm still struggling how to e

[PATCH] D48342: [libcxx] Optimize vectors construction of trivial types from an iterator range with const-ness mismatch.

2018-06-26 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi Volodymyr, thanks for working on this! Comment at: libcxx/include/memory:1479 +struct __has_construct_missing +: false_type +{ Shouldn't this be true_type? Comment at: libcxx/include/memory:1673-1677 +

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-06-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! If it'd make this easier to review, I'd be happy to split this up a bit. https://reviews.llvm.org/D46845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[PATCH] D48322: [Sema] Discarded statment should be an evaluatable context

2018-06-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: rsmith. The constexpr evaluator was erroring out because these templates weren't defined. Despite being used in a discarded statement, we still need to constexpr evaluate them, which means that we need to instantiate them.

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-06-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D46845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D47886: Move VersionTuple from clang/Basic to llvm/Support, clang part

2018-06-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM. Looks like LLDB has some uses of VersionTuple, you should fix those to #include the LLVM version before removing the header here. (Or, better yet, do it all atomically

[PATCH] D47887: Move VersionTuple from clang/Basic to llvm/Support, llvm part

2018-06-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM, thanks for adding the test! Repository: rL LLVM https://reviews.llvm.org/D47887 ___ cfe-commits mailing list cfe-commi

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-06-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: libcxx/include/__hash_table:2261 +_NodeHandle +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_extract_unique( +key_type const& __key) EricWF wrote: > If I'm not mistaken, `__node_handle_extract_uniqu

[PATCH] D47607: [libcxx] Almost fix some UB in and

2018-06-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 149449. erik.pilkington marked 10 inline comments as done. erik.pilkington added a comment. Address review comments. Thanks! https://reviews.llvm.org/D47607 Files: libcxx/include/__hash_table libcxx/include/__tree libcxx/include/map libcxx/i

[PATCH] D47607: [libcxx] Almost fix some UB in and

2018-06-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D47607#1118547, @EricWF wrote: > I should have asked, have we actually seen a midcompile caused by this? Is > there a reproducer? Or is this purerly speculative? Nope, pure speculation. I still think we should still fix this though.

[PATCH] D47607: [libcxx] Almost fix some UB in and

2018-05-31 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, EricWF, mclow.lists. Herald added subscribers: christof, kosarev. and define `__value_type` as a union between pair and pair so that various operations can move into/from these pairs [1]. This is a pretty blatant s

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-05-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D46845#1098634, @rsmith wrote: > One way we could deal with this is by adding an attribute to the compiler to > indicate "the const is a lie", that we can apply to `std::pair::first`, with > the semantics being that a top-level `const

[PATCH] D46747: [Sema] Use dotted form of macOS version for unguarded availability FixIts

2018-05-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. Great, LGTM! https://reviews.llvm.org/D46747 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D46747: [Sema] Use dotted form of macOS version for unguarded availability FixIts

2018-05-15 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. > I am now thinking about just switching to dot format in > ParseAvailabilityAttribute() because it's much simpler to maintain > consistency that way. Okay, but if we're going to treat underscores as dots while printing diagnostics and fixits (which I think we

[PATCH] D46845: [libcxx][c++17] P0083R5: Splicing Maps and Sets

2018-05-15 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. > One way we could deal with this is by adding an attribute to the compiler to > indicate "the const is a lie", that we can apply to `std::pair::first`, with > the semantics being that a top-level `const` is ignored when determining the > "real" type of the memb

[PATCH] D46747: [Sema] Use dotted form of macOS version for unguarded availability FixIts

2018-05-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. Thanks for the explanation, LGTM. https://reviews.llvm.org/D46747 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http:

[PATCH] D46747: [Sema] Use dotted form of macOS version for unguarded availability FixIts

2018-05-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. That test passes for me without this patch applied, why is UsesUnderscores actually getting set in the radar? Repository: rC Clang https://reviews.llvm.org/D46747 ___ cfe-commits mailing list cfe-commits@lists.ll

[PATCH] D45451: [ItaniumMangle] Undeduced auto type doesn't belong in the substitution table

2018-04-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/AST/ItaniumMangle.cpp:2342 + if (isa(Ty)) +return false; return true; rjmccall wrote: > rjmccall wrote: > > rjmccall wrote: > > > I agree with your analysis that this shouldn't be a substitution

[PATCH] D45451: [ItaniumMangle] Undeduced auto type doesn't belong in the substitution table

2018-04-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 143469. erik.pilkington added a comment. Add a comment. https://reviews.llvm.org/D45451 Files: clang/lib/AST/ItaniumMangle.cpp clang/test/CodeGenCXX/lambda-expressions-inside-auto-functions.cpp Index: clang/test/CodeGenCXX/lambda-expressions-i

[PATCH] D45699: [Availability] Improve availability to consider functions run at load time

2018-04-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM, thanks! Comment at: lib/Sema/SemaDecl.cpp:9134-9151 + // Diagnose availability attributes. Availability cannot be used on functions + // that are ru

[PATCH] D45699: [Availability] Improve availability to consider functions run at load time

2018-04-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi Steven, thanks for working on this! Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2916 + "ignoring availability attribute %select{on '+load' method|" + "with constructor attribute|with desctructor attribute}0">, + InGroup; ---

[PATCH] D45451: [ItaniumMangle] Undeduced auto type doesn't belong in the substitution table

2018-04-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 142402. erik.pilkington marked an inline comment as done. erik.pilkington added a comment. Add an ABI compatibility guard. Thanks! https://reviews.llvm.org/D45451 Files: clang/lib/AST/ItaniumMangle.cpp clang/test/CodeGenCXX/lambda-expressions-in

[PATCH] D45451: [ItaniumMangle] Undeduced auto type doesn't belong in the substitution table

2018-04-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, majnemer, rjmccall. Since "Da" and "Dc" (auto and decltype(auto)) are under in the mangling grammer, they shouldn't have a substitution (https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-compression). I b

[PATCH] D45194: [Sema] Defer checking constexpr lambda until after we've finished the lambda class.

2018-04-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. > LGTM - can you commit? Yep, I'll do that now. Thanks for reviewing! Comment at: clang/lib/AST/ExprConstant.cpp:5212 + cast(E)->refersToEnclosingVariableOrCapture()) { +// We don't track the lambda's captures in a potential constant e

[PATCH] D45194: [Sema] Defer checking constexpr lambda until after we've finished the lambda class.

2018-04-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4312 + } else if (MD && isLambdaCallOperator(MD) + && !Info.checkingPotentialConstantExpression()) { // We're in a lambda; determine the lambda capture field maps.

[PATCH] D45194: [Sema] Defer checking constexpr lambda until after we've finished the lambda class.

2018-04-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 141042. erik.pilkington marked an inline comment as done. erik.pilkington added a comment. Add refersToEnclosingVariableOrCaptureCheck(), comments. https://reviews.llvm.org/D45194 Files: clang/lib/AST/ExprConstant.cpp clang/test/SemaCXX/cxx1z-co

[PATCH] D45194: [Sema] Defer checking constexpr lambda until after we've finished the lambda class.

2018-04-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:12886 if (!IsInstantiation && FD && FD->isConstexpr() && !FD->isInvalidDecl() && +!isLambdaCallOperator(FD) && (!CheckConstexprFunctionDecl(FD) || faisalv wrote:

[PATCH] D45194: [Sema] Defer checking constexpr lambda until after we've finished the lambda class.

2018-04-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 141001. erik.pilkington marked an inline comment as done. erik.pilkington added a comment. Handle this in ExprConstant instead of in Sema. https://reviews.llvm.org/D45194 Files: clang/lib/AST/ExprConstant.cpp clang/test/SemaCXX/cxx1z-constexpr-l

[PATCH] D45194: [Sema] Defer checking constexpr lambda until after we've finished the lambda class.

2018-04-02 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, faisalv. Previously, this caused ExprConstant to assert while verifying the lambda is constexpr: void f() { int x = 0; [=]() constexpr { return x; }; } The problem is that ActOnFinish

[PATCH] D44589: [Sema] Make deprecation fix-it replace all multi-parameter ObjC method slots.

2018-03-26 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM, this is a really nice feature! Comment at: clang/include/clang/Basic/SourceLocation.h:202 +/// Can be used transparently in places where SourceLocatio

[PATCH] D44589: [Sema] Make deprecation fix-it replace all multi-parameter ObjC method slots.

2018-03-21 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi Volodymyr, thanks for working on this! Overall this looks good, I just have a few nits. Comment at: clang/include/clang/Basic/SourceLocation.h:202 +/// Can be used transparently in places where SourceLocation is expected. +class MultiSourceL

[PATCH] D41889: [libcxxabi][demangler] Clean up and llvm-ify the type parser

2018-02-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 132747. erik.pilkington added a comment. Rebase and remove the qualifier substitution bug fix. https://reviews.llvm.org/D41889 Files: src/cxa_demangle.cpp Index: src/cxa_demangle.cpp ===

[PATCH] D42776: [Sema] Fix an assertion failure in constant expression evaluation of calls to functions with default arguments

2018-02-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi Akira, thanks for working on this! Comment at: lib/AST/ExprConstant.cpp:1165-1173 + auto LB = Temporaries.lower_bound(Key); + + // If an element with key Key is found, reset the value and return it. This + // can happen if Key is part of a

[PATCH] D41887: [libcxxabi][demangler] Clean up and llvm-ify the expression parser

2018-01-31 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 132279. erik.pilkington added a comment. Rebase onto r323906. Most of this patch is just a mechanical transformation to the parser to use the new API, the interesting part is just the changes to the Db struct. https://reviews.llvm.org/D41887 Files

[PATCH] D41885: [libcxxabi][demangler] Improve handling of variadic templates

2018-01-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: src/cxa_demangle.cpp:260-261 + +#if 0 + void dump() const { +char *Buffer = static_cast(std::malloc(1024)); dexonsmith wrote: > Why is this behind `#if 0`? Should you just use something like > `LLVM_DUMP_M

[PATCH] D41885: [libcxxabi][demangler] Improve handling of variadic templates

2018-01-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 131535. erik.pilkington marked 2 inline comments as done. erik.pilkington added a comment. In this new patch: - Make the cached values use a 3-way bool type, and default it to false. This simplifies all the Node ctors. - Remove some minor style fixes

[PATCH] D41885: [libcxxabi][demangler] Improve handling of variadic templates

2018-01-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! Repository: rCXXA libc++abi https://reviews.llvm.org/D41885 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D41889: [libcxxabi][demangler] Clean up and llvm-ify the type parser

2018-01-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: EricWF, mclow.lists, dexonsmith. As of https://reviews.llvm.org/D41885, every parse_* function now either returns a single Node* or fails. I'm using this new rule to clean up the parsing for the demangler, and also update it

[PATCH] D41887: [libcxxabi][demangler] Clean up and llvm-ify the expression parser

2018-01-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: EricWF, mclow.lists, dexonsmith. As of https://reviews.llvm.org/D41885, every parse_* function now either returns a single Node* or fails. I'm using this new rule to clean up the parsing for the demangler, and also update it

[PATCH] D41885: [libcxxabi][demangler] Improve handling of variadic templates

2018-01-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: src/cxa_demangle.cpp:130 - // Offset of position in buffer, used for building stream_string_view. - typedef unsigned StreamPosition; - This caching API is being removed because it is no longer valid: if a node

[PATCH] D41885: [libcxxabi][demangler] Improve handling of variadic templates

2018-01-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: EricWF, mclow.lists, dexonsmith. This patch fixes some longstanding bugs in the demangler to do with it's handling of variadic templates. Currently the demangler handles variadic templates by expanding them into the Names s

[PATCH] D41261: [libcxxabi][demangler] Special case demangling for pass_object_size attribute

2017-12-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 127067. erik.pilkington added a comment. Add a testcase with pass_object_size[0-3]. https://reviews.llvm.org/D41261 Files: src/cxa_demangle.cpp test/test_demangle.pass.cpp Index: test/test_demangle.pass.cpp

[PATCH] D41261: [libcxxabi][demangler] Special case demangling for pass_object_size attribute

2017-12-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: EricWF, george.burgess.iv. This patch adds demangling for pass_object_size attribute (https://clang.llvm.org/docs/AttributeReference.html#pass-object-size). This attribute applies to function parameters. This attribute is ma

[PATCH] D40372: [ExprConstant] Fix assert when initializing constexpr array

2017-12-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D40372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D40566: Check if MemberExpr arguments are type-dependent.

2017-11-29 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi, thanks for working on this! Why don't we just set the TypeDependent bit to false when building the underlying MemberExpr here? Based on the section of the standard you quoted that node shouldn't be considered type-dependent, but it is by clang. I think this

[PATCH] D40445: [C++17] Allow an empty expression in an if init statement

2017-11-24 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi, thanks for working on this! Can you add tests to make sure that this also works with switch statements (which also have this bug), and not with while? Also, it makes it a lot easier to review these patches if you add context lines to the diff. Thanks, Erik

[PATCH] D40284: [Sema] Improve diagnostics for template arg deduction

2017-11-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. This looks correct, but I definitely agree that RAII would make this a lot nicer. Have you considered adding a `CancelableSaveAndRestore` or something to SaveAndRestore.h? It seems useful and generic enough to make it worthwhile. Otherwise, you could just write

<    1   2   3   4   5   6   >