[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-08-08 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 159832. Rakete added a comment. Rebase + friendly ping :) Repository: rC Clang https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/FixIt/fixit-cxx0x.cpp test/Parser/cxx0x-lambd

[PATCH] D50119: Compiler support for P1144R0 "__is_trivially_relocatable(T)"

2018-08-16 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. It would be nice to be able to diagnose `X`: template struct Foo { struct [[trivially_relocatable]] X { // no warning X(X &&) = delete; }; }; Foo f; // no warning static_assert(!__is_trivially_relocatable(Foo::X)); // ok But otherwise, you

[PATCH] D50766: Fix false positive unsequenced access and modification warning in array subscript expression.

2018-08-16 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete requested changes to this revision. Rakete added a comment. This revision now requires changes to proceed. Your patch breaks a lot of stuff in the test suite. For example: void f() { int A = 0; (A++, A) = 1; // warning from this patch, but this is perfectly valid since f

[PATCH] D41284: [Concepts] Associated constraints infrastructure.

2018-08-18 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: test/CXX/concepts-ts/temp/temp.constr/temp.constr.decl/var-template-decl.cpp:10 + +template requires bool(U()) +int B::A = int(U()); Quuxplusone wrote: > saar.raz wrote: > > Quuxplusone wrote: > > > For my own edifi

[PATCH] D37442: [C++17] Disallow lambdas in template parameters (PR33696).

2018-05-25 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 148555. Rakete added a comment. Rebase and friendly ping :) https://reviews.llvm.org/D37442 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp lib/Parse/ParseStmt.c

[PATCH] D39679: [C++11] Fix warning when dropping cv-qualifiers when assigning to a reference with a braced initializer list

2018-05-25 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 148564. Rakete added a comment. Rebased + friendly ping :) https://reviews.llvm.org/D39679 Files: lib/Sema/SemaInit.cpp test/SemaCXX/references.cpp Index: test/SemaCXX/references.cpp ==

[PATCH] D38342: [C++] Parse (sub) postfix expression after boolean literal

2017-09-27 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete created this revision. Rakete added a project: clang. Parsers a postfix expression after a boolean literal: This fixes PR34273 . https://reviews.llvm.org/D38342 Files: lib/Parse/ParseExpr.cpp test/CXX/expr/expr.post/expr.sub/p1.cp

[PATCH] D38342: [C++] Parse (sub) postfix expression after boolean literal

2017-09-28 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 117051. Rakete added a comment. - Moved test to test/CXX/ Do I actually need to -verify the test if no diagnostics are expected? Thanks @aaron.ballman https://reviews.llvm.org/D38342 Files: lib/Parse/ParseExpr.cpp test/Parser/cxx-bool.cpp Ind

[PATCH] D38342: [C++] Parse (sub) postfix expression after boolean literal

2017-09-28 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 117054. Rakete added a comment. - Fixed test case for bools Ah got it! Thanks!! https://reviews.llvm.org/D38342 Files: lib/Parse/ParseExpr.cpp test/Parser/cxx-bool.cpp Index: test/Parser/cxx-bool.cpp ===

[PATCH] D38342: [C++] Parse (sub) postfix expression after boolean literal

2017-09-28 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. Yes please :) Thanks @aaron.ballman https://reviews.llvm.org/D38342 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D37442: [C++17] Disallow lambdas in template parameters (PR33696).

2017-10-03 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 117568. Rakete added a comment. - rebased Does anyone have a better name than `ExpressionType`? I don't really like it. https://reviews.llvm.org/D37442 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Parse/Parse

[PATCH] D36918: [Sema] Take into account the current context when checking the accessibility of a member function pointer

2017-10-06 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: lib/Sema/SemaAccess.cpp:1798 + EffectiveContext EC(CurScope->getEntity()); + if (IsAccessible(*this, EC, Entity) == ::AR_accessible) +return AR_accessible; You don't need that scope resolution operator there. Al

[PATCH] D38216: [C++17] Fix class template argument deduction for default constructors without an initializer

2017-10-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 119035. Rakete added a comment. Rebased and friendly ping :) https://reviews.llvm.org/D38216 Files: lib/Sema/SemaDecl.cpp test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.class.deduct/p1.cpp test/Parser/cxx1z-class-template-argument-deduction.cpp

[PATCH] D39122: [Sema] Fixes for enum handling for tautological comparison diagnostics

2017-10-20 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: lib/Sema/SemaChecking.cpp:8610 + if(!S.getLangOpts().CPlusPlus && OtherT->isEnumeralType()) { +OtherT = OtherT->getAs()->getDecl()->getIntegerType(); Please drop the braces. Comment at: lib/S

[PATCH] D36101: Fix usage of right shift operator in fold expressions

2017-10-21 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 119767. Rakete added a comment. Used the naming convention of LLVM + friendly ping. :) https://reviews.llvm.org/D36101 Files: lib/Parse/ParseExpr.cpp test/Parser/cxx1z-fold-expressions.cpp Index: test/Parser/cxx1z-fold-expressions.cpp =

[PATCH] D38954: [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros other than NULL.

2017-10-23 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: lib/Sema/Sema.cpp:445 + // If it is a macro from system header, and if the macro name is not "NULL", + // do not warn. + SourceLocation MaybeMacroLoc = E->getLocStart(); That comment doesn't really add anything IMO

[PATCH] D50766: Fix false positive unsequenced access and modification warning in array subscript expression.

2018-08-26 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. > What do you think? Good idea! Comment at: test/SemaCXX/warn-unsequenced-cxx17.cpp:7 + // expected-no-diagnostics + p[(long long unsigned)(p = 0)] // ok +} Oh no, you forgot a semicolon there! :) https://reviews.llvm.org/D50766

[PATCH] D49848: Parse a possible trailing postsfix expression suffix after a fold expression

2018-07-26 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete created this revision. Rakete added a reviewer: rsmith. This patch allows the parsing of a postfix expression involving a fold expression, which is legal as a fold-expression is a primary-expression. See also https://llvm.org/pr38282 Repository: rC Clang https://reviews.llvm.

[PATCH] D49848: Parse a possible trailing postfix expression suffix after a fold expression

2018-07-26 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 157578. Rakete added a comment. @rsmith you're right, it should. But it doesn't, because the the fold expression is considered to be a cast expression by ParseParenExpression and which parses any postfix pieces immediately after a cast, but it doesn't

[PATCH] D49848: Parse a possible trailing postfix expression suffix after a fold expression

2018-07-26 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 157580. Rakete added a comment. Add a test without any casts. Repository: rC Clang https://reviews.llvm.org/D49848 Files: include/clang/Parse/Parser.h lib/Parse/ParseExpr.cpp test/Parser/cxx1z-fold-expressions.cpp Index: test/Parser/cxx1z-

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-07-26 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 157611. Rakete added a comment. Rebased + friendly ping Repository: rC Clang https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/Parser/cxx0x-lambda-expressions.cpp test/SemaCX

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-07-26 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 157642. Rakete added a comment. Addressed review comments. Note that clang doesn't support the fourth kind of lambda yet ([]<>), because https://reviews.llvm.org/D36527 hasn't been merged yet, so I didn't add a test case for that one. Repository:

[PATCH] D49848: Parse a possible trailing postfix expression suffix after a fold expression

2018-07-27 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 157759. Rakete added a comment. Addressed review comments :) Repository: rC Clang https://reviews.llvm.org/D49848 Files: include/clang/Parse/Parser.h lib/Parse/ParseExpr.cpp test/Parser/cxx1z-fold-expressions.cpp Index: test/Parser/cxx1z-fo

[PATCH] D49848: Parse a possible trailing postfix expression suffix after a fold expression

2018-07-27 Thread Nicolas Lesser via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL338170: Parse a possible trailing postfix expression suffix after a fold expression (authored by Rakete, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews

[PATCH] D50119: Compiler support for P1144R0 "__is_trivially_relocatable(T)"

2018-08-01 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. - There's a bug in your implementation: struct X { X &operator=(X &&); }; static_assert(__is_trivially_relocatable(X)); // oops, fires! `X` has a move constructor and a destructor, so it is trivially relocatable. - Please run your code through clang-format.

[PATCH] D50119: Compiler support for P1144R0 "__is_trivially_relocatable(T)"

2018-08-01 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: compiler-explorer-llvm-commit.sh:1 +# This is the commit of LLVM that we're currently based on. +git reset --hard 1fa19f68007cd126a04448093c171f40e556087e What's this file? A mistake? Comment at: in

[PATCH] D50119: Compiler support for P1144R0 "__is_trivially_relocatable(T)"

2018-08-02 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:6187 +Record->dropAttr(); + } else if (Record->needsImplicitMoveConstructor() && + Record->defaultedMoveConstructorIsDeleted()) { Quuxplusone wrote: > Rakete w

[PATCH] D50119: Compiler support for P1144R0 "__is_trivially_relocatable(T)"

2018-08-02 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:6187 +Record->dropAttr(); + } else if (Record->needsImplicitMoveConstructor() && + Record->defaultedMoveConstructorIsDeleted()) { Rakete wrote: > Quuxplusone w

[PATCH] D50119: Compiler support for P1144R0 "__is_trivially_relocatable(T)"

2018-08-02 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:6174 + Record->hasAttr() && + !isTemplateInstantiation(Record->getTemplateSpecializationKind())) { +if (Record->getDefinition() && !Record->isDependentContext() && The call to `i

[PATCH] D50119: Compiler support for P1144R0 "__is_trivially_relocatable(T)"

2018-08-02 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a reviewer: Rakete. Rakete added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:6091 + for (auto *F : Record->fields()) { +if (F->isMutable()) { Quuxplusone wrote: > Rakete wrote: > > Can you move this in `ActOnFields`?

[PATCH] D50291: [C++] Delay checking of constexpr-ness for special members.

2018-08-03 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete created this revision. Rakete added a reviewer: rsmith. Specific class layouts meant that the constexpr-ness of a special member could only be decided after every special member was seen. However, this was at odds with the implementation, which checked the constexpr-ness for each

[PATCH] D50291: [C++] Delay checking of constexpr-ness for special members.

2018-08-03 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 159160. Rakete added a comment. Add missing test cases. :) Repository: rC Clang https://reviews.llvm.org/D50291 Files: include/clang/Sema/Sema.h lib/Sema/SemaDeclCXX.cpp test/CXX/special/class.copy/p10.cpp Index: test/CXX/special/class.copy

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

2018-01-04 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 128659. Rakete added a comment. Rebased + friendly 2018 ping :) https://reviews.llvm.org/D40445 Files: lib/Parse/ParseExprCXX.cpp test/CXX/stmt.stmt/stmt.select/p3.cpp Index: test/CXX/stmt.stmt/stmt.select/p3.cpp

[PATCH] D39679: [C++11] Fix warning when dropping cv-qualifiers when assigning to a reference with a braced initializer list

2018-01-04 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 128661. Rakete added a comment. Rebased + friendly 2018 ping :) https://reviews.llvm.org/D39679 Files: lib/Sema/SemaInit.cpp test/SemaCXX/references.cpp Index: test/SemaCXX/references.cpp

[PATCH] D38216: [C++17] Fix class template argument deduction for default constructors without an initializer

2018-01-04 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 128662. Rakete marked an inline comment as done. Rakete added a comment. Rebased + friendly 2018 ping https://reviews.llvm.org/D38216 Files: lib/Sema/SemaDecl.cpp test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.class.deduct/p1.cpp test/Parser/c

[PATCH] D37442: [C++17] Disallow lambdas in template parameters (PR33696).

2018-01-04 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 128667. Rakete added a comment. Rebased + friendly 2018 ping https://reviews.llvm.org/D37442 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp lib/Parse/ParseStmt.

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-01-04 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 128668. Rakete added a comment. Rebased + friendly 2018 ping :) https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/Parser/cxx0x-lambda-expressions.cpp test/SemaCXX/new-delete-0x.

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

2018-01-05 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 128729. Rakete added a comment. Addressed review comments. I'll write up a patch in the next coming days then :) https://reviews.llvm.org/D40445 Files: lib/Parse/ParseExprCXX.cpp test/CXX/stmt.stmt/stmt.select/p3.cpp Index: test/CXX/stmt.stmt/st

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-01-05 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: lib/Parse/ParseExprCXX.cpp:2906-2912 +// Basic lookahead to check if we have a lambda expression. If we +// encounter two braces with a semicolon, we can be pretty sure +// that this is a lambda, not say a compound literal

[PATCH] D38216: [C++17] Fix class template argument deduction for default constructors without an initializer

2018-03-13 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 138187. Rakete added a comment. Addressed review comments :) Thanks! https://reviews.llvm.org/D38216 Files: lib/Sema/SemaDecl.cpp test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.class.deduct/p1.cpp test/Parser/cxx1z-class-template-argument-deducti

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-03-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 138335. Rakete added a comment. > Did you forget to upload the updated patch? This looks unchanged compared to > the prior version. Whoops, that's true. Sorry... https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-03-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. @rsmith Which type specifiers should I test for? just `T`? Or also `T*`, `T&`, ...? Now I'm just checking for an identifier, but anything else would make the lookahead more complicated I think. Any ideas? https://reviews.llvm.org/D36357 __

[PATCH] D37442: [C++17] Disallow lambdas in template parameters (PR33696).

2018-03-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 138337. Rakete added a comment. Rebase and ping :) https://reviews.llvm.org/D37442 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp lib/Parse/ParseStmt.cpp lib/

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

2018-03-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 138339. Rakete added a comment. Rebase and ping :) https://reviews.llvm.org/D40445 Files: lib/Parse/ParseExprCXX.cpp test/CXX/stmt.stmt/stmt.select/p3.cpp Index: test/CXX/stmt.stmt/stmt.select/p3.cpp =

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

2018-03-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. @rsmith Can you commit please? https://reviews.llvm.org/D40445 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D39679: [C++11] Fix warning when dropping cv-qualifiers when assigning to a reference with a braced initializer list

2018-03-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 138423. Rakete added a comment. Addressed review comments :) I added a test case for the crashing code. Note: I didn't change `Args[0]` to `OnlyArg` in `FK_AddressOfUnaddressableFunction`, because I'm pretty sure that C++ doesn't have unaddressable f

[PATCH] D44534: Fix codegen for structured binding binding in conditions

2018-03-15 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete created this revision. Rakete added reviewers: lichray, rsmith. Rakete added a project: clang. The codegen for conditions assumes that a normal variable declaration is used in a condition, but this is not the case when a structured binding is used. This fixes PR36747

[PATCH] D38216: [C++17] Fix class template argument deduction for default constructors without an initializer

2018-03-18 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 138862. Rakete added a comment. @lichray Ok done :) Thanks for reviewing https://reviews.llvm.org/D38216 Files: lib/Sema/SemaDecl.cpp test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.class.deduct/p1.cpp test/Parser/cxx1z-class-template-argument-dedu

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-06-21 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. @rsmith Should I only check for an identifier, like only "int" and nothing else? Because parsing a full type specifier might be a bit expensive, no? https://reviews.llvm.org/D36357 ___ cfe-commits mailing list cfe-commit

[PATCH] D39679: [C++11] Fix warning when dropping cv-qualifiers when assigning to a reference with a braced initializer list

2018-06-21 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 152370. Rakete added a comment. Rebased + friendly ping :) https://reviews.llvm.org/D39679 Files: lib/Sema/SemaInit.cpp test/SemaCXX/references.cpp Index: test/SemaCXX/references.cpp ==

[PATCH] D37442: [C++17] Disallow lambdas in template parameters (PR33696).

2018-06-21 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 152374. Rakete added a comment. Rebased + friendly ping :) https://reviews.llvm.org/D37442 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp lib/Parse/ParseStmt.cp

[PATCH] D39679: [C++11] Fix warning when dropping cv-qualifiers when assigning to a reference with a braced initializer list

2018-06-22 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 152441. Rakete added a comment. done :) Could you commit it please, @rsmith ? https://reviews.llvm.org/D39679 Files: lib/Sema/SemaInit.cpp test/SemaCXX/references.cpp Index: test/SemaCXX/references.cpp ===

[PATCH] D50766: Fix false positive unsequenced access and modification warning in array subscript expression.

2018-10-10 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. Sorry, for some reason I didn't see your updates. Can you add a test for C++17? Then your patch is good to go! :) https://reviews.llvm.org/D50766 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.

[PATCH] D50766: Fix false positive unsequenced access and modification warning in array subscript expression.

2018-10-10 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete accepted this revision. Rakete added a comment. This revision is now accepted and ready to land. Nevermind my last comment, I was tired. LGTM https://reviews.llvm.org/D50766 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[PATCH] D50766: Fix false positive unsequenced access and modification warning in array subscript expression.

2018-10-11 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: test/SemaCXX/warn-unsequenced-cxx17.cpp:1 +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 -Wno-unused %s + lebedev.ri wrote: > One last-minute thought: this is only a positive test. > You don't test what happens

[PATCH] D52750: [Diagnostics] Check for integer overflow in array size expressions

2018-10-11 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. The array size is still evaluated twice. Try to incorporate the check in `Sema::VerifyIntegerConstantExpression`. https://reviews.llvm.org/D52750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.

[PATCH] D52750: [Diagnostics] Check for integer overflow in array size expressions

2018-10-11 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. Nah, you don't even need to call `EvaluateForOverflow` I believe. :) Have a look overflow evaluation is done. https://reviews.llvm.org/D52750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/

[PATCH] D52750: [Diagnostics] Check for integer overflow in array size expressions

2018-10-12 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. This doesn't produce a warning in C++11 and up. https://reviews.llvm.org/D52750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52750: [Diagnostics] Check for integer overflow in array size expressions

2018-10-12 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. In https://reviews.llvm.org/D52750#1263466, @xbolva00 wrote: > In https://reviews.llvm.org/D52750#1263461, @Rakete wrote: > > > This doesn't produce a warning in C++11 and up. > > > But see Richard's comment: https://reviews.llvm.org/D52750#125175 so I am not > su

[PATCH] D53595: [C++17] Reject shadowing of capture by parameter in lambda

2018-10-23 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete created this revision. Rakete added a reviewer: rsmith. This change rejects the shadowing of a capture by a parameter in lambdas in C++17. int main() { int a; auto f = [a](int a) { return a; }; } results in: main.cpp:3:20: error: a lambda parameter cannot shadow an

[PATCH] D53595: [C++17] Reject shadowing of capture by parameter in lambda

2018-10-23 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: lib/Sema/SemaLambda.cpp:510 +for (const auto &Capture: Captures) { + if (Capture.Id && Capture.Id->getName() == Param->getName()) { +Error = true; erik.pilkington wrote: > You should compa

[PATCH] D53595: [C++17] Reject shadowing of capture by parameter in lambda

2018-10-23 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 170748. Rakete added a comment. Addressed review comments! :) Thanks Repository: rC Clang https://reviews.llvm.org/D53595 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaLambda.cpp test/SemaCXX/warn

[PATCH] D53595: [C++17] Reject shadowing of capture by parameter in lambda

2018-10-23 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 170757. Rakete added a comment. Use correct clang and version spelling. Repository: rC Clang https://reviews.llvm.org/D53595 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaLambda.cpp test/SemaCXX/w

[PATCH] D53595: [C++17] Reject shadowing of capture by parameter in lambda

2018-10-24 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 170828. Rakete added a comment. Addresed review comments :) I updated the dr status file but a lot of unrelated changes made it in. Is this okay? Repository: rC Clang https://reviews.llvm.org/D53595 Files: include/clang/Basic/DiagnosticSemaKin

[PATCH] D53595: [C++17] Reject shadowing of capture by parameter in lambda

2018-10-25 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. In https://reviews.llvm.org/D53595#1276330, @rsmith wrote: > In https://reviews.llvm.org/D53595#1273848, @Rakete wrote: > > > Addresed review comments :) > > > > I updated the dr status file but a lot of unrelated changes made it in. Is > > this okay? > > > Please

[PATCH] D53595: [C++17] Reject shadowing of capture by parameter in lambda

2018-10-25 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 171174. Rakete added a comment. Update DR list. https://reviews.llvm.org/D53595 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaLambda.cpp test/CXX/drs/dr22xx.cpp test/SemaCXX/warn-shadow-in-lambdas.

[PATCH] D53595: [C++17] Reject shadowing of capture by parameter in lambda

2018-10-25 Thread Nicolas Lesser via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC345308: [C++17] Reject shadowing of capture by parameter in lambda (authored by Rakete, committed by ). Repository: rC Clang https://reviews.llvm.org/D53595 Files: include/clang/Basic/Diagnostic

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-10-28 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 171421. Rakete added a comment. Rebase and friendly ping :) Repository: rC Clang https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/FixIt/fixit-cxx0x.cpp test/Parser/cxx0x-lam

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-10-29 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete created this revision. Rakete added a reviewer: rsmith. This patch implements P0634r3 that removes the need for 'typename' in certain contexts. For example, template using foo = T::type; // ok This is also allowed in previous language versions as an extension, because I th

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-10-29 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: test/CXX/temp/temp.res/p5.cpp:71 + +// FIXME: This is ok. +template I think the below is well-formed according to the quote above, but I'm not sure I understand it correctly. Repository: rC Clang https://review

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-10-29 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 171609. Rakete added a comment. Remove unneeded -Wc++2a-compat flag in tests. Repository: rC Clang https://reviews.llvm.org/D53847 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Parse/ParseDecl.cpp lib/Pars

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-10-29 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 171612. Rakete added a comment. Fix easy errors in tests that I missed by adding explicit template instantations. Repository: rC Clang https://reviews.llvm.org/D53847 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h

[PATCH] D56974: [SemaCXX] Fix ICE with structure bindings to members of template

2019-01-20 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. Yeah, seems like we don't instantiate `pair` at all in that specific case. LGTM but you might want to wait for someone else to confirm. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56974/new/ https://reviews.llvm.org/D56974 __

[PATCH] D56974: [SemaCXX] Fix ICE with structure bindings to members of template

2019-01-27 Thread Nicolas Lesser via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL352323: [SemaCXX] Fix ICE with structure bindings to members of template (authored by Rakete, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.o

[PATCH] D56974: [SemaCXX] Fix ICE with structure bindings to members of template

2019-01-27 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. Backporting to 8.0.0 is possibly possible, you'll need to ping Hans. I don't know about previous versions though. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56974/new/ https://reviews.llvm.org/D56974 _

[PATCH] D57540: [C++17] Don't crash while diagnosing different access specifier of a deduction guide.

2019-01-31 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete created this revision. Rakete added a reviewer: rsmith. This fixes PR40552 by not showing the diagnostic that complains about different access specifiers, since the template does not have one. Repository: rC Clang https://reviews.llvm.org/D57540 Files: lib/Sema/SemaDeclCXX.

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-11-01 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 172146. Rakete marked 6 inline comments as done. Rakete added a comment. Addressed review comments! :) Repository: rC Clang https://reviews.llvm.org/D53847 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Parse/Parser.h in

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-11-01 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete marked 7 inline comments as done. Rakete added inline comments. Comment at: lib/Parse/Parser.cpp:1778 +/*IsClassTemplateDeductionContext*/true, +/*AllowImplicitTypename*/false)) { SourceLocation BeginLoc = Tok.getLocation(); -

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-11-01 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 172147. Rakete marked an inline comment as done. Rakete added a comment. Remove spaces to be consistent. Repository: rC Clang https://reviews.llvm.org/D53847 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Parse/Parser.h

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-11-01 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: test/SemaCXX/unknown-type-name.cpp:50 template -void f(T::type) { } // expected-error{{missing 'typename'}} +void f(T::type) { } // expected-warning {{implicit 'typename' is a C++2a extension}} rsmith wrote: > Rak

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-11-01 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 172218. Rakete added a comment. I'm pretty sure I implemented the rules correctly now :) Repository: rC Clang https://reviews.llvm.org/D53847 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Parse/Parser.h include/clang/Sema/S

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-11-07 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 173056. Rakete added a comment. Addressed review comments! :) Repository: rC Clang https://reviews.llvm.org/D53847 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Parse/Parser.h include/clang/Sema/Sema.h lib/Parse/ParseDecl

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-11-07 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete marked 9 inline comments as done. Rakete added a comment. I also found another diagnostic regression: template T::type(); The previous error message was something with "nested name specifier does not refer to class ...". Now, the T::type part is interpreted as type and so we

[PATCH] D54414: [Sema] Make sure we substitute an instantiation-dependent default template parameter

2018-11-12 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete accepted this revision. Rakete added a comment. This revision is now accepted and ready to land. LGTM, thanks :) Comment at: clang/test/SemaCXX/alias-template.cpp:188 +template > +int sfinae_me() { return 0; } // expected-note{{candidate template ignored: substi

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-11-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: lib/Sema/Sema.cpp:2006-2019 +bool Sema::isDeclaratorFunctionLike(const Declarator &D) { + assert(D.getCXXScopeSpec().isSet() && + "can only be called for qualified names"); + LookupResult LR(*this, D.getIdentifier(), D.getBe

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-11-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 174158. Rakete marked 11 inline comments as done. Rakete added a comment. Addressed review comments :) Repository: rC Clang https://reviews.llvm.org/D53847 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Parse/Parser.h in

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-11-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: include/clang/Parse/Parser.h:2119 DeclSpecContext DSC = DeclSpecContext::DSC_normal, - LateParsedAttrList *LateAttrs = nullptr); + LateParsedAttrList *LateAttrs = nullptr) { +return ParseDeclarationSpecifiers(DS,

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-11-27 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 175553. Rakete added a comment. Rebase and friendly ping! :) Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53847/new/ https://reviews.llvm.org/D53847 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang

[PATCH] D55039: [sema] Warn of mangling change if function parameters are noexcept.

2018-11-28 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. You're missing the case of the function return type of a parameter. void f(void (*g())() noexcept); // no warning with trunk nor with your patch CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55039/new/ https://reviews.llvm.org/D55039 ___

[PATCH] D55039: [sema] Warn of mangling change if function parameters are noexcept.

2018-12-03 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: lib/Sema/SemaDecl.cpp:9933 +llvm::any_of(FPT->param_types(), + [](QualType Q) { return hasNoexcept(Q); })) + return true; You don't need this lambda. Comment at: lib

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2018-12-04 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 176554. Rakete added a comment. Rebase + friendly ping :) Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53847/new/ https://reviews.llvm.org/D53847 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Pa

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2019-03-10 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 190012. Rakete added a comment. Herald added a subscriber: jdoerfert. Herald added a project: clang. Fix a bug where `T::value` inside a functional cast in a template argument would be interpreted as a function type. Also added the missing test file t

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2019-03-10 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. rsmith: > Some thoughts on this: > > - Can this be unified with the lookup code in HandleDeclarator? This is > really the same lookup, repeated in two places. What I wrote: > I don't think so, because HandleDeclarator is called after having already > parsed the fu

[PATCH] D53847: [C++2a] P0634r3: Down with typename!

2019-03-10 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 190013. Rakete added a comment. Don't relookup the qualified-id and use the cached one instead if possible. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53847/new/ https://reviews.llvm.org/D53847 Files

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-03-13 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 190435. Rakete added a comment. Rebase + friendly ping :). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D36357/new/ https://reviews.llvm.org/D36357 Files: clang/include/clang/Basic/DiagnosticParseKind

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:2017 + auto LastIdx = Field != FieldEnd + ? Field->getFieldIndex() Can `Field` ever be `FieldEnd` at this point? Comment at: clang/lib/Sema

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp:30 +// out of order designators +A a1 = {.y = 1, .x = 2}; // expected-warning {{designated initializers are a C99 feature}} + hintonda wrote: > lebedev.ri wrote: >

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-26 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:2044 + : std::distance(RD->field_begin(), RD->field_end()); + if (VerifyOnly && (LastIdx >= NextIdx || HasNonDesignatedInit) && + SemaRef.getLangOpts().CPlusPlus2a) ---

[PATCH] D59900: [Sema] Fix a crash when nonnull checking

2019-03-28 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete accepted this revision. Rakete added a comment. This revision is now accepted and ready to land. Otherwise LGTM. Comment at: clang/test/SemaTemplate/decltype.cpp:1 +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s +// no crash & no diag tes

[PATCH] D60934: [clang] adding explicit(bool) from c++2a

2019-04-25 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. Thanks for working on this! :) Comment at: clang/lib/Parse/ParseDecl.cpp:3533 + if (ExplicitExpr.isInvalid()) { +Diag(ParenLoc, diag::note_explicit_bool_breaking_change_cxx2a) +<< FixItHint::CreateReplacement( ---

  1   2   >