[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] 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] 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] 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] 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] 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] 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 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-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] 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] 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] 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 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] 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-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] D48896: [libcxx][c++17] P0083R5: Splicing Maps and Sets Part 2: merge

2018-08-21 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] 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] 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] 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-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] 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] 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] D38483: [ExprConstant] Allow constexpr ctor to modify non static data members in body

2017-10-02 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Previously, clang rejected the following (copied from PR19741): struct A { int a = 0; constexpr A() { a = 1; } }; constexpr bool f() { constexpr A a; static_assert(a.a == 1, ""); return a.a == 1; } static_assert(f(), ""); Clang

[PATCH] D38483: [ExprConstant] Allow constexpr ctor to modify non static data members in body

2017-10-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 117529. erik.pilkington marked 2 inline comments as done. erik.pilkington added a comment. Thanks for the feedback, in this new patch: - insert EvaluatingDecl into EvaluatingConstructors instead of checking it in isEvaluatingDecl() - Add a comment to

[PATCH] D38483: [ExprConstant] Allow constexpr ctor to modify non static data members in body

2017-10-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/AST/ExprConstant.cpp:588 + : EI(EI), Object(Object) { +DidInsert = EI.EvaluatingConstructors.insert(Object).second; + } rsmith wrote: > Can the `DidInsert == false` case actually happen?

[PATCH] D51172: [libcxx] Comment out #define __cpp_lib_node_extract, we only support half of that functionality

2018-08-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: ldionne, mclow.lists, hans. Herald added a reviewer: EricWF. Herald added subscribers: dexonsmith, christof. The other half of this is in https://reviews.llvm.org/D48896, so we shouldn't claim that we support this feature. Th

[PATCH] D51172: [libcxx] Comment out #define __cpp_lib_node_extract, we only support half of that functionality

2018-08-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Landed as r340544. @hans: Can you cherry-pick? Repository: rCXX libc++ https://reviews.llvm.org/D51172 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D51189: [Sema][ObjC] Infer availability of +new from availability of -init

2018-08-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: arphaman. Herald added a subscriber: dexonsmith. rdar://18335828 Thanks! Erik Repository: rC Clang https://reviews.llvm.org/D51189 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/DeclObjC.h cl

[PATCH] D51189: [Sema][ObjC] Infer availability of +new from availability of -init

2018-08-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D51189#1211754, @arphaman wrote: > Hmm, I don't think this solution is ideal, we'd rather have an attribute > somewhere for other consumers of availability annotations. Does MyObject have > an implicit decl of `new`, or are we referri

[PATCH] D51649: [Sema] Don't warn about omitting unavailable enum constants in a switch

2018-09-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: arphaman. Herald added a subscriber: dexonsmith. rdar://42717026 Thanks for taking a look! Repository: rC Clang https://reviews.llvm.org/D51649 Files: clang/lib/Sema/SemaStmt.cpp clang/test/Sema/switch-availability

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

2018-09-05 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 164064. erik.pilkington added a comment. Ping! In the new patch: - Uncomment __cpp_lib_node_extract, reverting r340544 - Rebase/Clean up the diff a bit https://reviews.llvm.org/D48896 Files: libcxx/include/__hash_table libcxx/include/__node_han

[PATCH] D51697: [Sema] Clean up some __builtin_*_chk diagnostics

2018-09-05 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: aaron.ballman, rsmith. Herald added subscribers: kristina, dexonsmith. Namely, print the likely macro name when it's used, and include the actual computed sizes in the diagnostic message, which are sometimes not obvious. rda

[PATCH] D51189: [Sema][ObjC] Infer availability of +new from availability of -init

2018-09-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D51189#1211910, @steven_wu wrote: > I feel like this is a much tricky situation than just new and init. Following > example is the same situation. > > __attribute__((objc_root_class)) > @interface NSObject > - (void) foo; > - (

[PATCH] D51189: [Sema][ObjC] Infer availability of +new from availability of -init

2018-09-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 164316. erik.pilkington marked 4 inline comments as done. erik.pilkington added a comment. Address @arphaman's review comments. https://reviews.llvm.org/D51189 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/DeclObjC.h clan

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

2018-09-12 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] D51997: [clang] Make sure attributes on member classes are applied properly

2018-09-12 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:1267-1269 + // Instantiate the attributes on both the template declaration and the associated record declaration. + SemaRef.InstantiateAttrsForDecl(TemplateArgs, Pattern, Inst, La

[PATCH] D51997: [clang] Make sure attributes on member classes are applied properly

2018-09-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Looks good to me! @rsmith should probably have the final word though. Thanks for fixing this. Repository: rC Clang https://reviews.llvm.org/D51997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://li

[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] 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 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] 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] 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] 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] 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 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] D33450: Warn about uses of `@available` that can't suppress the -Wunguarded-availability warnings

2017-05-23 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/SemaExpr.cpp:15747 + // warn when it's used inappropriately (i.e. not if(@available)). + if (getCurFunctionOrMethodDecl

[PATCH] D33368: [libcxxabi][demangler] Fix a crash in the demangler

2017-05-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: src/cxa_demangle.cpp:3036 break; -if (db.names.size() < 2) +assert(k0 <= k1 && "parse_type() mutated the name stack"); +if (k1 == k0) --

[PATCH] D33368: [libcxxabi][demangler] Fix a crash in the demangler

2017-05-24 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. r303806 removes the assertion (instead just returning first). I though this should never happen, I'm looking into this testcase to see if there is another bug here. Thanks, Erik Repository: rL LLVM https://reviews.llvm.org/D33368 _

[PATCH] D33368: [libcxxabi][demangler] Fix a crash in the demangler

2017-05-24 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. > Also, are you now maintaining this code? > I am trying to find someone who wants to be CC-ed to other demangler bugs > automatically reported by oss-fuzz. I don’t think I’ll accept the title of maintainer, (I only have one commit in this file!) but I have som

[PATCH] D33661: [Sema][ObjC] Don't emit availability diagnostics for categories extending unavailable interfaces

2017-05-29 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Previously, @implementations of categories that extended unavailable/deprecated/partial @interfaces triggered availability diagnostics. There was no way to turn this off, as we check the use of the unavailable decl outside of the context of the @implementa

[PATCH] D33816: [Sema][ObjC] Don't allow -Wunguarded-availability to be silenced with redeclarations

2017-06-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. This patch drops support for suppressing -Wunguarded-availability with redeclarations. This was behavior left over from the -Wpartial-availability days, where it was the only way of silencing the diagnostic. Now that we have @available and better support f

[PATCH] D33977: [libcxx][WIP] Experimental support for a scheduler for use in the parallel stl algorithms

2017-06-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Herald added a reviewer: EricWF. This patch adds a simple work-stealing scheduler meant for use as a fallback implementation for the C++17 parallel stl algorithms. This scheme follows a very simple fork/join API that should be easy to map onto different und

[PATCH] D34096: [Sema][C++1z] Ensure structured binding's bindings in dependent foreach have non-null type

2017-06-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. A DecompositionDecls' bindings have a null type until the initializer is attached, if the initializer is dependent, then the bindings should be set to have dependent type. For non-foreach bindings, this is done in Sema::CheckCompleteDecompositionDeclaratio

[PATCH] D33977: [libcxx][WIP] Experimental support for a scheduler for use in the parallel stl algorithms

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

[PATCH] D34264: Introduce -Wunguarded-availability-new, which is like -Wunguarded-availability, except that it's enabled by default for new deployment targets

2017-06-15 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:7315 + default: +assert(!Triple.isMacOSX() && "MacOS should be handled in the switch"); +// New targets should always warn about availability. This assert seems a bit redundant,

[PATCH] D33816: [Sema][ObjC] Don't allow -Wunguarded-availability to be silenced with redeclarations

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

[PATCH] D34264: Introduce -Wunguarded-availability-new, which is like -Wunguarded-availability, except that it's enabled by default for new deployment targets

2017-06-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:6944 -diag = !ObjCPropertyAccess ? diag::err_unavailable - : diag::err_property_method_unavailable; -diag_message = diag::err_unavailable_message; W

[PATCH] D34264: Introduce -Wunguarded-availability-new, which is like -Wunguarded-availability, except that it's enabled by default for new deployment targets

2017-06-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:7031 +Introduced) && +!S.Diags.isIgnored(diag::warn_unguarded_availability_new, Loc); +diag = NewWarning ? diag::warn_partial_availability_new Sorry to keep this

[PATCH] D34264: Introduce -Wunguarded-availability-new, which is like -Wunguarded-availability, except that it's enabled by default for new deployment targets

2017-06-22 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 working on this! Repository: rL LLVM https://reviews.llvm.org/D34264 ___ cfe-commits mailing list cfe-commi

[PATCH] D33606: [Sema] Fix a crash-on-invalid when a template parameter list has a class definition or non-reference class type

2017-06-22 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! https://reviews.llvm.org/D33606 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mai

[PATCH] D34556: [libcxx] Annotate c++17 aligned new/delete operators with availability attribute

2017-06-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp:35 + // expected-error@-10 {{call to unavailable function 'operator new[]': introduced in macOS 10.13}} + // expected-note@new:

[PATCH] D33816: [Sema][ObjC] Don't allow -Wunguarded-availability to be silenced with redeclarations

2017-06-24 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 103852. erik.pilkington added a comment. Improve enum diagnostics, as @arphaman suggested. This causes a bit of churn throughout the availability diagnostic machinery, if it would make it at all easier to review, I would be happy to separate out thes

[PATCH] D33816: [Sema][ObjC] Don't allow -Wunguarded-availability to be silenced with redeclarations

2017-06-26 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 103958. erik.pilkington added a comment. Make the diagnostic reference the context declaration instead of the offending decl if no enclosing decl is found, fixing the diagnostic bug @arphaman pointed out. https://reviews.llvm.org/D33816 Files: i

[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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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

[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] D53048: [Basic] Split out -Wimplicit-int-conversion and -Wimplicit-float-conversion from -Wconversion

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, aaron.ballman. Herald added a subscriber: dexonsmith. These two diagnostics are noisy, so its reasonable for users to opt-out of them when -Wconversion is enabled. Fixes rdar://45058981 Thanks for taking a look! R

[PATCH] D53048: [Basic] Split out -Wimplicit-int-conversion and -Wimplicit-float-conversion from -Wconversion

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/test/Sema/implicit-int-conversion.c:1-4 +// RUN: %clang_cc1 -Wconversion -Wno-implicit-int-conversion -DSMALL=char -DBIG=int -DNO_DIAG +// RUN: %clang_cc1 -Wno-conversion -Wimplicit-int-conversion -DSMALL=char -DBIG=int +

[PATCH] D53048: [Basic] Split out -Wimplicit-int-conversion and -Wimplicit-float-conversion from -Wconversion

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 168912. erik.pilkington added a comment. Actually run the tests! https://reviews.llvm.org/D53048 Files: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Basic/DiagnosticSemaKinds.td clang/test/Sema/implicit-int-conversion.c

[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 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] D53154: [CodeGen] Handle extern references to OBJC_CLASS_$_*

2018-10-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rjmccall, ahatanak, jfb. Herald added a subscriber: dexonsmith. Some ObjC users declare a `extern` variable named `OBJC_CLASS_$_Foo`, then use it's address as a `Class`. I.e., one could define `isInstanceOfF`: BOOL isInsta

[PATCH] D53522: [Frontend] Include module map header declaration in dependency file output

2018-10-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: bruno, rsmith. Herald added a subscriber: dexonsmith. This patch makes clang include headers found in modulemap files in the `.d` file. This is necessary to capture symlinked headers, which previously were ignored, since onl

  1   2   3   4   5   6   >