[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-04-01 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/StdStreamObjectsOutsideMainCheck.cpp:25 + .bind("match"), + this); +} mgartmann wrote: > mgartmann wrote: > > riccibruno wrote: > > > Will this match

[PATCH] D99646: [clang-tidy] misc-std-stream-objects-outside-main: a new check

2021-03-31 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/StdStreamObjectsOutsideMainCheck.cpp:25 + .bind("match"), + this); +} Will this match `my_namespace::cin`? Comment at:

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-05 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:337 + if (Name.empty()) +Name = ""; + return Name; I think that this will become unreachable after D84658 and D85033. I may be missing

[PATCH] D87831: [clang] Expose helper function to turn PP keywords spelling into PPKeywordKind

2020-09-17 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/include/clang/Basic/TokenKinds.h:99 +PPKeywordKind getPPKeywordFromSpelling(const std::string ); + A string is expensive here and unneeded. Why not a `StringRef`? Comment at:

[PATCH] D87540: [clang-tidy] Fix false positive issue in performance-unnecessary-value-param for arguments being moved in the function body.

2020-09-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp:74 + // parmVarDecl picked up by this checker. It will be an empty string and will + // lead to an assertion failure when using hasName(std::string) being

[PATCH] D87278: [Ignore Expressions] Fix performance regression by inlining `Ignore*SingleStep`

2020-09-08 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno accepted this revision. riccibruno added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87278/new/ https://reviews.llvm.org/D87278 ___ cfe-commits mailing list

[PATCH] D84599: [Index/USRGeneration] Use NamedDecl::getDeclName() instead of NamedDecl::printName in USRGenerator::EmitDeclName

2020-09-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. To make this patch more acceptable I could also add a `Visit` function for `DecompositionDecl` and `MSGuidDecl` such that the current behaviour is preserved (I won't be able to test it though since these implicit AST nodes are not visited). Repository: rG LLVM

[PATCH] D85960: [AST][FPEnv] Keep FP options in trailing storage of CastExpr

2020-09-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. > This change allow a CallExpr to have optional FPOptionsOverride object, Should this be `CastExpr` instead? > stored in trailing storage. The implementaion is made similar to the way > used in CallExpr. Nit, but that's not really similar. In the `CallExpr` case the

[PATCH] D80878: [clang] Prevent that Decl::dump on a CXXRecordDecl deserialises further declarations.

2020-09-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. And what if deserialization is forced? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80878/new/ https://reviews.llvm.org/D80878 ___ cfe-commits mailing list

[PATCH] D85613: [clang] Look through bindings when checking whether a default argument references a local entity.

2020-09-02 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 2 inline comments as done. riccibruno added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:91 + auto CheckAndDiagnoseLocalEntity = [&](const VarDecl *VD, unsigned DiagID, + const auto &... DiagArgs) -> bool

[PATCH] D86207: (De-)serialize BindingDecls before DecompositionDecl

2020-09-02 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D86207#2252409 , @aaronpuchert wrote: > In D86207#2251802 , @riccibruno > wrote: > >> Is my comment on the deserialization of `BindingDecl`s in >>

[PATCH] D87004: [analyzer] Evaluate PredefinedExpressions

2020-09-02 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/Analysis/eval-predefined-exprs.cpp:7-21 + clang_analyzer_dump(__func__); + clang_analyzer_dump(__FUNCTION__); + clang_analyzer_dump(__PRETTY_FUNCTION__); + // expected-warning@-3 {{{"func",0 S64b,char}}} + //

[PATCH] D86207: (De-)serialize BindingDecls before DecompositionDecl

2020-09-02 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Is my comment on the deserialization of `BindingDecl`s in https://reviews.llvm.org/D85613?id=284364 related to this change? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86207/new/ https://reviews.llvm.org/D86207

[PATCH] D87004: [analyzer] Evaluate PredefinedExpressions

2020-09-02 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/Analysis/eval-predefined-exprs.cpp:7-21 + clang_analyzer_dump(__func__); + clang_analyzer_dump(__FUNCTION__); + clang_analyzer_dump(__PRETTY_FUNCTION__); + // expected-warning@-3 {{{"func",0 S64b,char}}} + //

[PATCH] D87004: [analyzer] Evaluate PredefinedExpressions

2020-09-02 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. > I don't know how could a `PredefinedExpression` lack the function name, > probably @riccibruno or @rjmccall can help with this - according to D53605 > . A `PredefinedExpr` whose declaration context is dependent has no name (see

[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

2020-08-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Friendly ping on this patch: this is the last change to `SequenceChecker` I had in mind. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81003/new/ https://reviews.llvm.org/D81003

[PATCH] D84599: [Index/USRGeneration] Use NamedDecl::getDeclName() instead of NamedDecl::printName in USRGenerator::EmitDeclName

2020-08-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Friendly ping on this patch; the patches depending on this patch (D84658 and D85033 on Phab + others not uploaded yet) significantly improve the handling of unnamed entities in diagnostics.

[PATCH] D85613: [clang] Look through bindings when checking whether a default argument references a local entity.

2020-08-11 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 284803. riccibruno added a comment. Remove the now-unused `const VarDecl *` parameter to `DiagnoseIfOdrUse`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85613/new/ https://reviews.llvm.org/D85613 Files:

[PATCH] D85536: [clang] Add a matcher for template template parameters.

2020-08-11 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf4dccf115cc1: [clang] Add a matcher for template template parameters. (authored by riccibruno). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85536/new/

[PATCH] D85613: [clang] Look through bindings when checking whether a default argument references a local entity.

2020-08-11 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:112 // if (DRE->isNonOdrUse() != NOUR_Unevaluated) return S.Diag(DRE->getBeginLoc(), This can use `DiagnoseIfOdrUse` as soon as the inconsistency between parameters

[PATCH] D85613: [clang] Look through bindings when checking whether a default argument references a local entity.

2020-08-11 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/include/clang/AST/DeclCXX.h:3843 /// The declaration that this binding binds to part of. + // FIXME: Currently not set during deserialization of the BindingDecl; + // only set when the corresponding DecompositionDecl is

[PATCH] D85613: [clang] Look through bindings when checking whether a default argument references a local entity.

2020-08-11 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 284718. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85613/new/ https://reviews.llvm.org/D85613 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D85613: [clang] Look through bindings when checking whether a default argument references a local entity.

2020-08-10 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p7.cpp:51 + extern void h8a(int = sizeof(z)); // ok + extern void h8b(int = w); // expected-error {{default argument references local variable 'w'}}

[PATCH] D85613: [clang] Look through bindings when checking whether a default argument references a local entity.

2020-08-10 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 284364. riccibruno marked 2 inline comments as done. riccibruno edited the summary of this revision. riccibruno added a comment. Refer to the binding in the diagnostic. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D85144: [clang] Improve Dumping of APValues

2020-08-09 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. I agree with you that it's fine to use `printPretty` for leaves (and additionally it would be annoying to duplicate the `LValue` case); that's what I was planning to do anyway. What I am not sure I agree with is the additional complexity to handle the

[PATCH] D85613: [clang] Look through bindings when checking whether a default argument references a local entity.

2020-08-09 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: rsmith, erichkeane, rjmccall. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. riccibruno requested review of this revision. Currently clang accepts a default argument containing a structured binding which is

[PATCH] D85612: [Sema] Use proper integral cast for an enumerate with a fixed bool type

2020-08-09 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/AST/ast-dump-enum-bool.cpp:1 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -ast-dump=json %s | FileCheck %s + Why a (pretty unreadable) json test? There is also `make-ast-dump-check.sh`

[PATCH] D80514: [clang-tidy] modernize-use-trailing-return-type support for C++20 concepts and decltype

2020-08-08 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-use-trailing-return-type.cpp:1 -// RUN: %check_clang_tidy -std=c++14,c++17 %s modernize-use-trailing-return-type %t -- -- -fdeclspec -fexceptions +// RUN: %check_clang_tidy

[PATCH] D80514: [clang-tidy] modernize-use-trailing-return-type support for C++20 concepts and decltype

2020-08-08 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-use-trailing-return-type.cpp:1 -// RUN: %check_clang_tidy -std=c++14,c++17 %s modernize-use-trailing-return-type %t -- -- -fdeclspec -fexceptions +// RUN: %check_clang_tidy

[PATCH] D85545: [Diagnostics] Diagnose missing comma in string array initialization

2020-08-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Is there a way to suppress this diagnostic if someone wants to legitimately initialize an element of the array with a long string by relying on string literal concatenation? Comment at: clang/lib/Sema/SemaExpr.cpp:6910 <<

[PATCH] D84599: [Index/USRGeneration] Use NamedDecl::getDeclName() instead of NamedDecl::printName in USRGenerator::EmitDeclName

2020-08-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. ... or if a string such as `(unnamed struct at /path/to/input.cc:1:3)` is suitable in an USR then `printName` can be used. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84599/new/ https://reviews.llvm.org/D84599

[PATCH] D85536: [clang] Add a matcher for template template parameters.

2020-08-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: aaron.ballman, klimek, njames93. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. riccibruno requested review of this revision. There are already matchers for type template parameters and non-type template

[PATCH] D85144: [clang] Improve Dumping of APValues

2020-08-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/include/clang/AST/PrettyPrinter.h:222 + /// Whether null pointers should be printed as nullptr or as NULL. + unsigned UseNullptr : 1; + riccibruno wrote: > This seems to be unrelated. And anyway shouldn't

[PATCH] D85144: [clang] Improve Dumping of APValues

2020-08-03 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/lib/AST/APValue.cpp:539 Out << '[' << Path[I].getAsArrayIndex() << ']'; -ElemTy = Ctx.getAsArrayType(ElemTy)->getElementType(); +ElemTy = cast(ElemTy.getCanonicalType())->getElementType(); }

[PATCH] D85144: [clang] Improve Dumping of APValues

2020-08-03 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Thanks for finishing this. I don't see why you are adding `dumpPretty`; the point of the `dump` function I added is to dump the `APValue` as the tree-like structure it is. But your `dumpPretty` doesn't do that at all. Instead it is just an alias for `printPretty`.

[PATCH] D83261: [OPENMP]Redesign of OMPExecutableDirective representation.

2020-08-03 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:345 Diag(Loc, diag::err_omp_declare_mapper_wrong_var) -<< DMD->getVarName().getAsString(); +<< getOpenMPDeclareMapperVarName(); Diag(D->getLocation(),

[PATCH] D84599: [clang-index] Use NamedDecl::getDeclName() instead of NamedDecl::printName in USRGenerator::EmitDeclName

2020-08-03 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. (Disclaimer: I am not at all familiar with this code) **A few notes in no particular order**: Some entities with special names should presumably be mangled, but are currently not. Example: namespace special_names { struct S { operator int(); }; int

[PATCH] D85033: [clang] Provide a better pretty-printed name for unnamed parameters, lambda classes and lambda captures.

2020-08-01 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 282391. riccibruno edited the summary of this revision. riccibruno added a comment. Don't forget to increment the field iterator in the loop of `maybePrintFieldForLambdaCapture`, and modify the tests to test this. Repository: rG LLVM Github Monorepo

[PATCH] D85033: [clang] Provide a better pretty-printed name for unnamed parameters, lambda classes and lambda captures.

2020-07-31 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 282312. riccibruno added a comment. Add `-fno-delayed-template-parsing` to the new unit tests to also pass on Windows. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85033/new/

[PATCH] D84678: [clang] False line number in a function definition with "void" parameter

2020-07-31 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG38d3e7533279: [clang] Use the location of the void parameters when complaining that only a… (authored by Jac1494, committed by riccibruno). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D85033: [clang] Provide a better pretty-printed name for unnamed parameters, lambda classes and lambda captures.

2020-07-31 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 282296. riccibruno added a comment. Make the unit tests in `NamedDeclPrinterTest.cpp` more robust. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85033/new/ https://reviews.llvm.org/D85033 Files:

[PATCH] D84678: [clang] False line number in a function definition with "void" parameter

2020-07-31 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84678#2187747 , @riccibruno wrote: > In D84678#2184687 , @Jac1494 wrote: > >> Hi @aaron.ballman , >> Address your review comments. >> Thank you for accepting this. I don't have

[PATCH] D84678: [clang] False line number in a function definition with "void" parameter

2020-07-31 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84678#2184687 , @Jac1494 wrote: > Hi @aaron.ballman , > Address your review comments. > Thank you for accepting this. I don't have commit access please commit this. > Thanks. As discussed with Aaron on IRC I can commit it

[PATCH] D85033: [clang] Provide a better name for unnamed parameters, lambda classes and lambda captures.

2020-07-31 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: erichkeane, rsmith. riccibruno added a project: clang. Herald added subscribers: cfe-commits, arphaman. riccibruno requested review of this revision. As a follow up to D84658 : For an unnamed

[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

2020-07-30 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 281999. riccibruno edited the summary of this revision. riccibruno added a comment. Rebased with a few clang-format fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81003/new/

[PATCH] D84005: Introduce ns_error_domain attribute.

2020-07-29 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:3650 S.Diag(Field->getLocation(), diag::warn_transparent_union_attribute_field_size_align) << isSize << *Field << FieldBits; gribozavr2 wrote: > Please

[PATCH] D84005: Introduce ns_error_domain attribute.

2020-07-29 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:5342 +S.Diag(Loc, diag::err_nserrordomain_invalid_decl) +<< 1 << DRE->getNameInfo().getName(); +return; Just send the declaration into the diagnostic. See the recent

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 281373. riccibruno added a comment. Add the forgotten context. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84658/new/ https://reviews.llvm.org/D84658 Files: clang/include/clang/AST/Decl.h

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 281371. riccibruno edited the summary of this revision. riccibruno added a comment. Use a less generic name instead of `get{Open,Close}Delimiter`. I went with `get{Open,Close}DelimiterForUnnamedEntity` but I am happy to change it. Repository: rG LLVM

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Note that I am planning two improvements as a follow-up to this patch: - For a parameter `(unnamed variable at {{.*}}:: of type )` -> `(unnamed parameter at {{.*}}:: of type )` - For a lambda: - `(unnamed class at {{.*}}::)` -> `(lambda at {{.*}}::)` - For a

[PATCH] D84599: [clang-index] Use NamedDecl::getDeclName() instead of NamedDecl::printName in USRGenerator::EmitDeclName

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. The overloads of `NamedDecl::printName` are in D84658 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84599/new/ https://reviews.llvm.org/D84599

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf5acd11d2c0e: [clang-format][NFC] Be more careful about the layout of FormatToken. (authored by riccibruno). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D84656: [clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics.

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGeb10b065f2a8: [clang] Pass the NamedDecl* instead of the DeclarationName into many… (authored by riccibruno). Changed prior to commit:

[PATCH] D84678: [clang] False line number in a function definition with "void" parameter

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/Sema/void-argument.cpp:1 +// RUN: not %clang_cc1 %s 2>&1 | FileCheck %s + Jac1494 wrote: > riccibruno wrote: > > These kinds of tests are typically done with a `-verify` test. See the > > other tests in

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84306#2177985 , @MyDeveloperDay wrote: > Thank you for the patch, this LGTM, I think this kind of change should help > reduce memory usage and I feel improves the readability. Thanks for your review! Repository: rG

[PATCH] D84678: [clang] False line number in a function definition with "void" parameter

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/Sema/void-argument.cpp:1 +// RUN: not %clang_cc1 %s 2>&1 | FileCheck %s + These kinds of tests are typically done with a `-verify` test. See the other tests in `Sema/` for examples. Repository: rG

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: clang/lib/AST/Decl.cpp:2032 + // additional complexity needed to prevent this is not worthwhile. + OS << (Policy.MSVCFormatting ? '`' : '(') + << (IsAnonymousStructOrUnion ?

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 281044. riccibruno marked 3 inline comments as done. riccibruno added a comment. Address Erich's comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84658/new/ https://reviews.llvm.org/D84658 Files:

[PATCH] D84656: [clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics.

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84656#2176139 , @aaron.ballman wrote: > The changes LGTM but it seems like there may be some formatting issues with > the patch (or the lint tool is acting up). Looks like the bot is right this time. Thanks!

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 281019. riccibruno marked 2 inline comments as done. riccibruno added a comment. Remove a few missed `getPackingKind`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84306/new/

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: clang/lib/AST/Decl.cpp:2032 + // additional complexity needed to prevent this is not worthwhile. + OS << (Policy.MSVCFormatting ? '`' : '(') + << (IsAnonymousStructOrUnion ?

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 2 inline comments as done. riccibruno added inline comments. Comment at: clang/lib/AST/Decl.cpp:2032 + // additional complexity needed to prevent this is not worthwhile. + OS << (Policy.MSVCFormatting ? '`' : '(') + << (IsAnonymousStructOrUnion ?

[PATCH] D81865: use string tables for static diagnostic descriptions

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Add some reviewers based on `git diff --name-only | xargs -n 1 git blame --porcelain | grep "^author " | sort | uniq -c | sort -nr | head -30`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81865/new/

[PATCH] D84656: [clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics.

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84656#2175813 , @erichkeane wrote: > I looked through the code changes, and they all seem quite mechanical. I > believe they are all correct. > > After reading through the test changes, I believe that this change is >

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: rsmith, aaron.ballman, erichkeane. riccibruno added a project: clang. Herald added subscribers: cfe-commits, arphaman, dexonsmith. See D84656 for the background on `NamedDecl::printName`. This patch

[PATCH] D84656: [clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics.

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: rsmith, aaron.ballman, erichkeane. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. Background: --- There are two related argument types which can be sent into a diagnostic to display the name of an

[PATCH] D84461: [Concepts] Fix ast dump for immediately declared constraint.

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/AST/ast-dump-concepts.cpp:1 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++2a -ast-dump -ast-dump-filter Foo %s | FileCheck -strict-whitespace %s + Can you also test for serialization by

[PATCH] D84136: [clang] Fix visitation of ConceptSpecializationExpr in constrained-parameter

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. > Will do. By the way, is there something more tailored than ninja check-clang > to run these ast-dump tests? ninja check-clang takes quite a while to run... You can use `check-clang-ast` for the lit tests in `AST/`, `check-clang-sema` for the lit tests in `Sema/`

[PATCH] D84599: [clang-index] Use NamedDecl::getDeclName() instead of NamedDecl::printName in USRGenerator::EmitDeclName

2020-07-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 280734. riccibruno added a comment. Update a comment I originally missed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84599/new/ https://reviews.llvm.org/D84599 Files: clang/lib/Index/USRGeneration.cpp

[PATCH] D84599: [clang-index] Use NamedDecl::getDeclName() instead of NamedDecl::printName in USRGenerator::EmitDeclName

2020-07-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: akyrtzi, jkorous, sammccall, hokein. riccibruno added a project: clang. Herald added subscribers: cfe-commits, arphaman, dexonsmith. `NamedDecl::printName` is used as a customisation point for `getNameForDiagnostic`. The default

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 280730. riccibruno added a comment. Use `is` and `isNot`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84306/new/ https://reviews.llvm.org/D84306 Files: clang/lib/Format/ContinuationIndenter.cpp

[PATCH] D84005: Introduce ns_error_domain attribute.

2020-07-24 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:5344 + if (!S.LookupName(lookupResult, S.TUScope) || + !lookupResult.getAsSingle()) { +S.Diag(IdentLoc->Loc, diag::err_nserrordomain_invalid_decl) Just a note that

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-23 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 3 inline comments as done. riccibruno added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:652 + (Current.isNot(TT_LineComment) || + Previous.getBlockKind() == BK_BracedInit)) { State.Stack.back().Indent = State.Column +

[PATCH] D84343: [AST] Keep FP options in trailing storage of CallExpr

2020-07-22 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/AST/ast-dump-fpfeatures.cpp:1 +// RUN: %clang_cc1 -fsyntax-only %s -std=c++11 -ast-dump | FileCheck %s + Can you also test the serialization by round-tripping through a PCH (see the other AST dump tests

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-22 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: MyDeveloperDay. riccibruno added a project: clang-format. Herald added a project: clang. Herald added a subscriber: cfe-commits. The underlying ABI forces `FormatToken` to have a lot of padding. Currently (on x86-64 linux)

[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

2020-07-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Friendly ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81003/new/ https://reviews.llvm.org/D81003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D84048: DR2303: Prefer 'nearer' base classes during template deduction.

2020-07-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. > Ah, doh, I see a few now. Is that number the compiler version number? Yup CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84048/new/ https://reviews.llvm.org/D84048 ___ cfe-commits mailing list

[PATCH] D84048: DR2303: Prefer 'nearer' base classes during template deduction.

2020-07-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84048#2165026 , @erichkeane wrote: > In D84048#2165023 , @riccibruno > wrote: > > > > Also make sure to update the the cxx_dr_status.html document. > > > > It is auto-generated. You

[PATCH] D84048: DR2303: Prefer 'nearer' base classes during template deduction.

2020-07-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. > Also make sure to update the the cxx_dr_status.html document. It is auto-generated. You need to tag the test case: `dr2303: 12`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84048/new/ https://reviews.llvm.org/D84048

[PATCH] D84090: [clang-format] Add BitFieldColonSpacing option

2020-07-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84090#2162389 , @MyDeveloperDay wrote: > Nit:clang-format the patch > > Here is a Tip as to what I do (In case it helps other): > > 1. I generate the diff off the staged items so I've already git added all the > files I'm

[PATCH] D83901: [clang] Disable a few formatting options for test/

2020-07-19 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG13316a770535: [clang] Disable a few formatting options for test/ (authored by riccibruno). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83901/new/

[PATCH] D82880: Fix PR35677: UB on __int128_t or __uint128_t template parameters.

2020-07-18 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In addition to Aaron's suggestion, can you also change the diff's title to something a little bit more informative. Suggestion: "[clang] Handle 128-bits IntegerLiterals in StmtPrinter", and say in the description that this addresses PR35677. Repository: rG LLVM

[PATCH] D83681: [clang] Provide a more specific diagnostic for a misplaced lambda capture-default.

2020-07-18 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG32db24a7f242: [clang] Provide a more specific diagnostic for a misplaced lambda capture… (authored by riccibruno). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D83901: [clang] Disable a few formatting options for test/

2020-07-17 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D83901#2155127 , @MyDeveloperDay wrote: > clang-format -n warnings before this change in clang/test/Analysis/*.cpp > (clang-format -n *.cpp |& grep warning | wc -l) > > before = 6903 vs after=6595, if it helps I'd say

[PATCH] D83901: [clang] Disable a few formatting options for test/

2020-07-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: aaron.ballman, jdoerfert, lebedev.ri, MyDeveloperDay. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. Hopefully this will make the bot a little less noisy. Rationale for each: `AlignTrailingComments`: We

[PATCH] D83681: [clang] Provide a more specific diagnostic for a misplaced lambda capture-default.

2020-07-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/lib/Parse/ParseExprCXX.cpp:937 + return Invalid([&] { +Diag(Tok.getLocation(), diag::err_capture_default_first); + }); aaron.ballman wrote: > Would it make sense to provide a fix-it to move

[PATCH] D83681: [clang] Provide a more specific diagnostic for a misplaced lambda capture-default.

2020-07-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 278164. riccibruno marked 3 inline comments as done. riccibruno added a comment. Add some tests showing that a by-ref capture is still parsed properly, including some tests with a capture containing a pack expansion. Repository: rG LLVM Github

[PATCH] D83681: [clang] Provide a more specific diagnostic for a misplaced lambda capture-default.

2020-07-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 278150. riccibruno added a comment. clang-format again, sigh... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83681/new/ https://reviews.llvm.org/D83681 Files:

[PATCH] D83681: [clang] Provide a more specific diagnostic for a misplaced lambda capture-default.

2020-07-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 277987. riccibruno retitled this revision from "[clang] Diagnose a misplaced lambda capture-default." to "[clang] Provide a more specific diagnostic for a misplaced lambda capture-default.". riccibruno added a comment. Get rid of the note which doesn't

[PATCH] D83681: [clang] Diagnose a misplaced lambda capture-default.

2020-07-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 277561. riccibruno added a comment. clang-format the tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83681/new/ https://reviews.llvm.org/D83681 Files:

[PATCH] D83438: [AST] Fix potential nullptr dereference in Expr::HasSideEffects

2020-07-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. I think that adding an unittest for such a simple fix is a bit heavy handed. What about just exercising this code path. For example: void Test(int N) { int arr[N]; decltype([]{}) *p; // expected-error {{lambda expression in an unevaluated operand}} }

[PATCH] D83681: [clang] Diagnose a misplaced lambda capture-default.

2020-07-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: rsmith, aaron.ballman. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. Currently a capture-default which is not the first element in the lambda-capture is diagnosed with a generic `expected variable name or

[PATCH] D83529: Summary: [clang] Provide a way for WhileStmt to report the location of its LParen and RParen.

2020-07-10 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno accepted this revision. riccibruno added a comment. This revision is now accepted and ready to land. No objection from me, but I am not a reviewer. I am just accepting this to cancel my comment on the missing serialization. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D83529: Summary: [clang] Provide a way for WhileStmt to report the location of its LParen and RParen.

2020-07-10 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno requested changes to this revision. riccibruno added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/Serialization/ASTReaderStmt.cpp:275 + S->setLParenLoc(readSourceLocation()); + S->setRParenLoc(readSourceLocation()); }

[PATCH] D82805: [clang] Fix a crash on passing C structure of incompatible type to function with reference parameter

2020-07-08 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1ba6fb929396: [clang] Fix a crash when passing a C structure of incompatible type to a… (authored by ArcsinX, committed by riccibruno). Changed prior to commit:

[PATCH] D82805: [clang] Fix a crash on passing C structure of incompatible type to function with reference parameter

2020-07-08 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno accepted this revision. riccibruno added a comment. This revision is now accepted and ready to land. This LGTM, with a few wording nits. > This patch fix clang crashes at using these functions in C and passing > incompatible structures as parameters in case of >

[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

2020-07-08 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. @rsmith I have modified this patch to address your comment above (we should track where default argument(s) and/or default member initializer(s) were used). You accepted this originally but I would like to make sure that you are happy with the updated patch. I was

[PATCH] D83183: [clang] Rework how and when APValues are dumped

2020-07-07 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rGf63e3ea558bb: [clang] Rework how and when APValues are dumped (authored by riccibruno). Changed prior to commit:

[PATCH] D83183: [clang] Rework how and when APValues are dumped

2020-07-06 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf63e3ea558bb: [clang] Rework how and when APValues are dumped (authored by riccibruno). Changed prior to commit: https://reviews.llvm.org/D83183?vs=275783=275828#toc Repository: rG LLVM Github

[PATCH] D83183: [clang] Rework how and when APValues are dumped

2020-07-06 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 2 inline comments as done. riccibruno added a comment. Thanks for your comments! In D83183#2132975 , @aaron.ballman wrote: > Do none of the JSON tests break from this change? No, but only because I am not modifying the JSON output at

  1   2   3   4   5   6   7   >