[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Richard Smith via cfe-commits
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) { return nullptr; } +// Sorted common C++ non-keyword types. +static SmallVector CppNonKeywordTypes = { +"byte", "int16_t", "int32_t", "int64_t", "int8_t", +"size_t", "uint16_t", "uint32_t", "uint64

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Richard Smith via cfe-commits
zygoloid wrote: > This patch does not only fix formatting of C-casting to a C++ standard type. > It correctly identifies (most of) such types and might have fixed other kinds > of bugs. Sure, this patch seems like a good change. But it does not fix #83400. https://github.com/llvm/llvm-project

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Richard Smith via cfe-commits
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) { return nullptr; } +// Sorted common C++ non-keyword types. +static SmallVector CppNonKeywordTypes = { +"byte", "int16_t", "int32_t", "int64_t", "int8_t", +"size_t", "uint16_t", "uint32_t", "uint64

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-03 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/83709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

2024-03-04 Thread Richard Smith via cfe-commits
zygoloid wrote: > It does fix the example given. #83400 has 6 real-world examples. This patch fixes none of them. It also has a reduced testcase, which this patch does fix. But fixing the reduced testcase without fixing the real-world examples is not fixing the bug. https://github.com/llvm/l

[llvm] [clang] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-30 Thread Richard Smith via cfe-commits
zygoloid wrote: It might be academic at this point, but for what it's worth, `__builtin_dynamic_object_size` is not a GCC builtin that clang copied, it's [a clang builtin](https://reviews.llvm.org/D56760) that GCC copied. https://github.com/llvm/llvm-project/pull/78526

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-02-01 Thread Richard Smith via cfe-commits
@@ -1051,6 +1052,145 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +/// \p StructBaseExpr returns the base \p Expr with a structure or union type

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-02-01 Thread Richard Smith via cfe-commits
@@ -1051,6 +1052,145 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +/// \p StructBaseExpr returns the base \p Expr with a structure or union type

[clang] [clang-format] adds a space after not inside macros (PR #78176)

2024-02-04 Thread Richard Smith via cfe-commits
@@ -4842,7 +4842,7 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, return true; } if (Left.is(TT_UnaryOperator)) { -if (Right.isNot(tok::l_paren)) { +if (!Right.isOneOf(tok::r_paren, tok::l_paren, tok::exclaim)) { zygoloi

[clang] [clang-format] adds a space after not inside macros (PR #78176)

2024-02-04 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/78176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] adds a space after not inside macros (PR #78176)

2024-02-04 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/78176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] adds a space after not inside macros (PR #78176)

2024-02-04 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/78176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] adds a space after not inside macros (PR #78176)

2024-02-04 Thread Richard Smith via cfe-commits
@@ -4842,7 +4842,7 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, return true; } if (Left.is(TT_UnaryOperator)) { -if (Right.isNot(tok::l_paren)) { +if (!Right.isOneOf(tok::r_paren, tok::l_paren, tok::exclaim)) { zygoloi

[clang] [clang-tools-extra] [mlir] [llvm] [compiler-rt] [clang] Fix a bug with qualified name lookup into current instantiation (PR #73018)

2024-01-29 Thread Richard Smith via cfe-commits
zygoloid wrote: > I'm not sure I understand why gcc is giving an error in > https://godbolt.org/z/qGfnzhfsK. It doesn't give an error with `typename` > keyword and I think there shouldn't be any difference since `Y::E` refers to > current instantiation and is being used by class member declara

[clang-tools-extra] [llvm] [clang] [clang] Add test for CWG472 (PR #67948)

2024-01-12 Thread Richard Smith via cfe-commits
zygoloid wrote: > None of the implementations seem to agree with the resolution of the DR: > https://godbolt.org/z/a7nEvW5Gr Yeah, I think this is a case where the wording is clear and everyone implements it, but it doesn't actually do the right thing. The example in the issue "ought to be" i

[clang-tools-extra] [llvm] [clang] [clang] Add test for CWG472 (PR #67948)

2024-01-12 Thread Richard Smith via cfe-commits
@@ -2871,7 +2871,7 @@ C++ defect report implementation status https://cplusplus.github.io/CWG/issues/472.html";>472 drafting Casting across protected inheritance -Not resolved +No zygoloid wrote: For `"no drafting" status, can we say somet

[clang] [Clang] Implement P2718R0 "Lifetime extension in range-based for loops" (PR #76361)

2024-01-17 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/76361 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2718R0 "Lifetime extension in range-based for loops" (PR #76361)

2024-01-17 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: This looks good to me. https://github.com/llvm/llvm-project/pull/76361 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2718R0 "Lifetime extension in range-based for loops" (PR #76361)

2024-01-17 Thread Richard Smith via cfe-commits
@@ -9959,6 +9976,18 @@ class Sema final { return currentEvaluationContext().isImmediateFunctionContext(); } + bool isInLifetimeExtendingContext() const { +assert(!ExprEvalContexts.empty() && + "Must be in an expression evaluation context"); +return Exp

[clang] [Clang] Implement P2718R0 "Lifetime extension in range-based for loops" (PR #76361)

2024-01-17 Thread Richard Smith via cfe-commits
@@ -1357,6 +1363,19 @@ class Sema final { // VLAs). bool InConditionallyConstantEvaluateContext = false; +/// Whether we are currently in a context in which temporaries must be +/// lifetime-extended (Eg. in a for-range initializer). +bool IsInLifetimeExten

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-17 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: We've discussed this before, years ago. Previously, the sticking point was: how is LLVM going to know what the frontend considers the closest surrounding subobject to be? The LLVM type doesn't give you that information, and it seems like there's nowhere e

[llvm] [clang] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-18 Thread Richard Smith via cfe-commits
zygoloid wrote: > When you say that we can't detect what the front-end considers the "closest > surrounding subobject" to be, is that mostly due to corner cases or is it a > more general concern? It's a more general concern: LLVM simply has no idea what the frontend considers to be a subobjec

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Richard Smith via cfe-commits
zygoloid wrote: > For unions, clang will use the type of the union member with the largest size > as the alloca type, regardless of which union member is active. I haven't > tried, but your patch will probably compute the subobject size based on that > arbitrarily picked member, rather than th

[llvm] [clang] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Richard Smith via cfe-commits
zygoloid wrote: > > But mode 0 and 1 are in general asking for an upper bound on the accessible > > bytes (that is, an N so any.access beyond N bytes is definitely out of > > bounds), so it seems to me that returning -1 is strictly worse than > > returning 48. > > It's the second bit that con

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Richard Smith via cfe-commits
zygoloid wrote: Taking a step back, while this patch is not the right direction, we can and should do better for the original example. Probably the best way to do that is to analyze the operand to `__builtin_[dynamic_]object_size` in the frontend and compute a better bound based on the form of

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Richard Smith via cfe-commits
zygoloid wrote: > Perhaps we need clarification on what GCC means by "may point to multiple > objects" in this instance. To me that means either "get me the size of the > largest of these multiple objects" or "size of the smallest." In my eyes, > that means pointing to a union field. Per @nik

[llvm] [clang] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Richard Smith via cfe-commits
zygoloid wrote: > My answer for the question "what's the semantics of GCC's builtin X?" has > always been "whatever GCC does." It's the best we can rely upon. But then we > get into situations like this, where you and @nikic have one interpretation > of their documentation and I have another.

[clang] [CodeGen] -fsanitize=alignment: add cl::opt sanitize-alignment-builtin to disable memcpy instrumentation (PR #69240)

2023-10-18 Thread Richard Smith via cfe-commits
@@ -66,6 +66,11 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +static llvm::cl::opt ClSanitizeAlignmentBuiltin( +"sanitize-alignment-builtin", llvm::cl::Hidden, +llvm::cl::desc("Instrument builtin functions for -fsanitize=alignment"), +ll

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-20 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/66894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-20 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: Thanks, this looks good to me other than a small test coverage (see comment) / diagnostic wording issue. (For future reference, please don't force-push to PR branches; that makes it much harder for your reviewer to see what's changed since their last revi

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-20 Thread Richard Smith via cfe-commits
@@ -140,11 +140,12 @@ void g28(void) { typedef short v12i16 __attribute((vector_size(24))); typedef long double v2f80 __attribute((vector_size(24))); // CHECK: @g28.a = internal global <1 x i64> - // CHECK: @g28.b = internal global <12 x i16> - // CHECK: @g28.c = inte

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-21 Thread Richard Smith via cfe-commits
@@ -140,11 +140,12 @@ void g28(void) { typedef short v12i16 __attribute((vector_size(24))); typedef long double v2f80 __attribute((vector_size(24))); // CHECK: @g28.a = internal global <1 x i64> - // CHECK: @g28.b = internal global <12 x i16> - // CHECK: @g28.c = inte

[clang] [clang][AST] Fix printing `TagDecl`s. (PR #69971)

2023-10-23 Thread Richard Smith via cfe-commits
zygoloid wrote: I think this might be working around the issue rather than fixing it. It looks to me like the bug is in `Decl::printGroup`: https://github.com/llvm/llvm-project/blob/f4023d4d5d6a6f35ef2315f1b1ce7dd35f24e901/clang/lib/AST/DeclPrinter.cpp#L223 We are printing the tag *definition*

[clang] [clang][AST] Fix printing `TagDecl`s. (PR #69971)

2023-10-23 Thread Richard Smith via cfe-commits
zygoloid wrote: It looks like this regressed in https://github.com/llvm/llvm-project/commit/9359b8fe5d944c8355ea49ba949d481fe080cec9 -- prior to that, we did check whether the tag declaration in the group was a definition before deciding whether to include it as part of the group. https://git

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-24 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. Thanks, LGTM https://github.com/llvm/llvm-project/pull/66894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Ensure zero-init is not overridden when initializing a base class in a constant expression context (PR #70150)

2023-10-24 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. https://github.com/llvm/llvm-project/pull/70150 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: r261008 - Add a nullPointerConstant() AST matcher to handle variations of null pointer constants in one matcher.

2019-08-22 Thread Richard Smith via cfe-commits
(Sorry for the very late review!) On Tue, 16 Feb 2016 at 13:06, Aaron Ballman via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: aaronballman > Date: Tue Feb 16 15:02:23 2016 > New Revision: 261008 > > URL: http://llvm.org/viewvc/llvm-project?rev=261008&view=rev > Log: > Add a nullPoi

Re: r369591 - [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)

2019-08-22 Thread Richard Smith via cfe-commits
Hi Matthias, This introduces false positives into -Wreturn-stack-address for an example such as: #include std::vector::iterator downcast_to(std::vector::iterator value) { return *&value; } This breaks an internal build bot for us, so I'm going to revert this for now (though I expect this isn

r369677 - Revert "[LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)"

2019-08-22 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Aug 22 10:48:11 2019 New Revision: 369677 URL: http://llvm.org/viewvc/llvm-project?rev=369677&view=rev Log: Revert "[LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)" This reverts commit r369591, because it causes the formerl

Re: r369591 - [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)

2019-08-22 Thread Richard Smith via cfe-commits
Reverted in r369677. On Thu, 22 Aug 2019 at 10:34, Richard Smith wrote: > Hi Matthias, > > This introduces false positives into -Wreturn-stack-address for an example > such as: > > #include > > std::vector::iterator downcast_to(std::vector::iterator value) { > r

r369722 - PR42587: diagnose unexpanded uses of a pack parameter of a generic

2019-08-22 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Aug 22 18:41:48 2019 New Revision: 369722 URL: http://llvm.org/viewvc/llvm-project?rev=369722&view=rev Log: PR42587: diagnose unexpanded uses of a pack parameter of a generic lambda from within the lambda-declarator. Modified: cfe/trunk/lib/Sema/SemaLambda.cpp cfe

r369725 - Revert "PR42587: diagnose unexpanded uses of a pack parameter of a generic" due to buildbot breakage.

2019-08-22 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Aug 22 19:33:46 2019 New Revision: 369725 URL: http://llvm.org/viewvc/llvm-project?rev=369725&view=rev Log: Revert "PR42587: diagnose unexpanded uses of a pack parameter of a generic" due to buildbot breakage. This reverts commit r369722. Modified: cfe/trunk/lib/Sem

Re: r369591 - [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)

2019-08-23 Thread Richard Smith via cfe-commits
would be OK, but otherwise I think we should temporarily roll this back until it can be moved to a separate warning group. Both, sorry for the breakage! > > Am Do., 22. Aug. 2019 um 19:47 Uhr schrieb Richard Smith < > rich...@metafoo.co.uk>: > >> Reverted in r369677.

Re: r369591 - [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)

2019-08-23 Thread Richard Smith via cfe-commits
;ll move these behind a flag today. Moving forward, it would be great >>> to have a way to dogfood those warnings without blocking you. We do run >>> them over ~340 open source projects regularly, but clearly that is not >>> enough :) >>> >>> Thanks, &

r369829 - PR40674: fix assertion failure if a structured binding declaration has a

2019-08-23 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Aug 23 18:23:57 2019 New Revision: 369829 URL: http://llvm.org/viewvc/llvm-project?rev=369829&view=rev Log: PR40674: fix assertion failure if a structured binding declaration has a tuple-like decomposition that produces value-dependent reference bindings. Modified: cf

r369834 - PR42513: Enter the proper DeclContext before substituting into an

2019-08-23 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Aug 23 19:30:00 2019 New Revision: 369834 URL: http://llvm.org/viewvc/llvm-project?rev=369834&view=rev Log: PR42513: Enter the proper DeclContext before substituting into an default template argument expression. We already did this for type template parameters and templat

r369932 - Fix use of invalidated iterator introduced by r369680.

2019-08-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Aug 26 10:31:06 2019 New Revision: 369932 URL: http://llvm.org/viewvc/llvm-project?rev=369932&view=rev Log: Fix use of invalidated iterator introduced by r369680. Modified: cfe/trunk/lib/Basic/FileManager.cpp Modified: cfe/trunk/lib/Basic/FileManager.cpp URL: http:/

r369940 - Improve behavior in the case of stack exhaustion.

2019-08-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Aug 26 11:18:07 2019 New Revision: 369940 URL: http://llvm.org/viewvc/llvm-project?rev=369940&view=rev Log: Improve behavior in the case of stack exhaustion. Summary: Clang performs various recursive operations (such as template instantiation), and may use non-trivial amo

r369941 - Fix file header.

2019-08-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Aug 26 11:21:13 2019 New Revision: 369941 URL: http://llvm.org/viewvc/llvm-project?rev=369941&view=rev Log: Fix file header. Modified: cfe/trunk/lib/Basic/Stack.cpp Modified: cfe/trunk/lib/Basic/Stack.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/

r369944 - [msvc] Add necessary #include to make compiler intrinsics available.

2019-08-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Aug 26 11:33:15 2019 New Revision: 369944 URL: http://llvm.org/viewvc/llvm-project?rev=369944&view=rev Log: [msvc] Add necessary #include to make compiler intrinsics available. Modified: cfe/trunk/lib/Basic/Stack.cpp Modified: cfe/trunk/lib/Basic/Stack.cpp URL: http

r369985 - PR42587: diagnose unexpanded uses of a pack parameter of a generic

2019-08-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Aug 26 15:51:28 2019 New Revision: 369985 URL: http://llvm.org/viewvc/llvm-project?rev=369985&view=rev Log: PR42587: diagnose unexpanded uses of a pack parameter of a generic lambda from within the lambda-declarator. Instead of trying to reconstruct whether a parameter pa

Re: r363820 - Add a script to help generate expected test output for dumping the AST to JSON.

2019-08-26 Thread Richard Smith via cfe-commits
Hi Aaron, I tried using this script to update a json dump test, and it seems to not really work very well: 1) it's really inconvenient to invoke; you need to pass in a --clang, copy some options out from two different places in the test file (from the RUN line and from a "--filters" line), and gu

Re: r369986 - [clang-scan-deps] Minimizer: Correctly handle multi-line content with CR+LF line endings

2019-08-26 Thread Richard Smith via cfe-commits
On Mon, 26 Aug 2019 at 16:17, Alexandre Ganea via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: aganea > Date: Mon Aug 26 16:19:21 2019 > New Revision: 369986 > > URL: http://llvm.org/viewvc/llvm-project?rev=369986&view=rev > Log: > [clang-scan-deps] Minimizer: Correctly handle multi-

r369999 - Don't lose the FoundDecl and template arguments for a DeclRefExpr in

2019-08-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Aug 26 18:06:21 2019 New Revision: 36 URL: http://llvm.org/viewvc/llvm-project?rev=36&view=rev Log: Don't lose the FoundDecl and template arguments for a DeclRefExpr in TreeTransform. Modified: cfe/trunk/lib/Sema/TreeTransform.h Modified: cfe/trunk/lib/Sema/T

r370000 - Revert "[clang-scan-deps] Minimizer: Correctly handle multi-line content with CR+LF line endings"

2019-08-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Aug 26 18:06:23 2019 New Revision: 37 URL: http://llvm.org/viewvc/llvm-project?rev=37&view=rev Log: Revert "[clang-scan-deps] Minimizer: Correctly handle multi-line content with CR+LF line endings" This reverts commit r369986. This change added a dependency on t

r370419 - Fix silent wrong-code bugs and crashes with designated initialization.

2019-08-29 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Aug 29 15:49:34 2019 New Revision: 370419 URL: http://llvm.org/viewvc/llvm-project?rev=370419&view=rev Log: Fix silent wrong-code bugs and crashes with designated initialization. We failed to correctly handle the 'holes' left behind by designated initializers in VerifyOnl

r370417 - Refactor InitListChecker to make it a bit clearer that hasError is only

2019-08-29 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Aug 29 15:49:32 2019 New Revision: 370417 URL: http://llvm.org/viewvc/llvm-project?rev=370417&view=rev Log: Refactor InitListChecker to make it a bit clearer that hasError is only set to true in VerifyOnly mode in cases where it's also set to true when actually building th

r370418 - Refactor InitListChecker to check only a single (explicit) initializer

2019-08-29 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Aug 29 15:49:33 2019 New Revision: 370418 URL: http://llvm.org/viewvc/llvm-project?rev=370418&view=rev Log: Refactor InitListChecker to check only a single (explicit) initializer list, rather than recursively checking multiple lists in C. This simplification is in prepara

r370544 - [c++20] Implement semantic restrictions for C++20 designated

2019-08-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Aug 30 15:52:55 2019 New Revision: 370544 URL: http://llvm.org/viewvc/llvm-project?rev=370544&view=rev Log: [c++20] Implement semantic restrictions for C++20 designated initializers. This has some interesting interactions with our existing extensions to support C99 design

r370555 - [c++20] Disallow template argument deduction from a braced-init-list

2019-08-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Aug 30 17:05:50 2019 New Revision: 370555 URL: http://llvm.org/viewvc/llvm-project?rev=370555&view=rev Log: [c++20] Disallow template argument deduction from a braced-init-list containing designators. The C++20 wording doesn't actually say what happens in this case, but tr

r370558 - [c++20] Add support for designated direct-list-initialization syntax.

2019-08-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Aug 30 18:00:37 2019 New Revision: 370558 URL: http://llvm.org/viewvc/llvm-project?rev=370558&view=rev Log: [c++20] Add support for designated direct-list-initialization syntax. This completes the implementation of P0329R4. Added: cfe/trunk/test/Parser/cxx2a-designat

r370688 - Split -Wreorder into different warnings for reordering a constructor

2019-09-02 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Sep 2 16:17:32 2019 New Revision: 370688 URL: http://llvm.org/viewvc/llvm-project?rev=370688&view=rev Log: Split -Wreorder into different warnings for reordering a constructor mem-initializer list and for reordering a designated initializer list. Modified: cfe/trunk/

r370689 - Rename -Wc++20-designator to -Wc++2a-designator for consistency and add

2019-09-02 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Sep 2 16:27:54 2019 New Revision: 370689 URL: http://llvm.org/viewvc/llvm-project?rev=370689&view=rev Log: Rename -Wc++20-designator to -Wc++2a-designator for consistency and add some test coverage for the flag. Modified: cfe/trunk/include/clang/Basic/DiagnosticGroup

r370795 - [www] Mark items complete in Clang 9 as 'Clang 9' rather than 'SVN'.

2019-09-03 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Sep 3 10:49:51 2019 New Revision: 370795 URL: http://llvm.org/viewvc/llvm-project?rev=370795&view=rev Log: [www] Mark items complete in Clang 9 as 'Clang 9' rather than 'SVN'. Don't turn the boxes green yet, since Clang 9 hasn't been released. Modified: cfe/trunk/ww

r370801 - Disable stack exhaustion test on NetBSD, where either the detection or

2019-09-03 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Sep 3 11:00:44 2019 New Revision: 370801 URL: http://llvm.org/viewvc/llvm-project?rev=370801&view=rev Log: Disable stack exhaustion test on NetBSD, where either the detection or recovery mechanism does not appear to work. Modified: cfe/trunk/test/SemaTemplate/stack-e

r370972 - [c++20] P1143R2: Add support for the C++20 'constinit' keyword.

2019-09-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Sep 4 13:30:37 2019 New Revision: 370972 URL: http://llvm.org/viewvc/llvm-project?rev=370972&view=rev Log: [c++20] P1143R2: Add support for the C++20 'constinit' keyword. This is mostly the same as the [[clang::require_constant_initialization]] attribute, but has a coupl

r370987 - [www] Fix hyperlink syntax in attribute reference.

2019-09-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Sep 4 14:31:22 2019 New Revision: 370987 URL: http://llvm.org/viewvc/llvm-project?rev=370987&view=rev Log: [www] Fix hyperlink syntax in attribute reference. Modified: cfe/trunk/include/clang/Basic/AttrDocs.td Modified: cfe/trunk/include/clang/Basic/AttrDocs.td URL:

r370986 - [www] Update attribute reference for 'constinit'.

2019-09-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Sep 4 14:31:21 2019 New Revision: 370986 URL: http://llvm.org/viewvc/llvm-project?rev=370986&view=rev Log: [www] Update attribute reference for 'constinit'. Modified: cfe/trunk/include/clang/Basic/Attr.td cfe/trunk/include/clang/Basic/AttrDocs.td Modified: cfe/t

r370991 - For PR43213, track whether template parameters are implicit through

2019-09-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Sep 4 15:14:50 2019 New Revision: 370991 URL: http://llvm.org/viewvc/llvm-project?rev=370991&view=rev Log: For PR43213, track whether template parameters are implicit through template instantiation so we know whether to mangle them in lambda-expressions. Modified: cf

r371004 - [c++20] Fix some ambiguities in our mangling of lambdas with explicit

2019-09-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Sep 4 18:23:47 2019 New Revision: 371004 URL: http://llvm.org/viewvc/llvm-project?rev=371004&view=rev Log: [c++20] Fix some ambiguities in our mangling of lambdas with explicit template parameters. This finishes the implementation of the proposal described in https://git

Re: r371222 - [Diagnostics] Refactor code for -Wsizeof-pointer-div, catch more cases; also add -Wsizeof-array-div

2019-09-06 Thread Richard Smith via cfe-commits
In addition to the below, this also seems to be missing any test coverage for the new warning. Did you forget to add a test file? On Fri, 6 Sep 2019 at 12:38, Nico Weber via cfe-commits < cfe-commits@lists.llvm.org> wrote: > This reports things like > > error: expresion will return the incorrect

r371252 - Update comment for mangling to match extended mangling rule in r371004.

2019-09-06 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Sep 6 13:32:01 2019 New Revision: 371252 URL: http://llvm.org/viewvc/llvm-project?rev=371252&view=rev Log: Update comment for mangling to match extended mangling rule in r371004. Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp Modified: cfe/trunk/lib/AST/ItaniumMang

Re: r371004 - [c++20] Fix some ambiguities in our mangling of lambdas with explicit

2019-09-06 Thread Richard Smith via cfe-commits
On Thu, 5 Sep 2019 at 17:39, Nico Weber via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On Wed, Sep 4, 2019 at 9:22 PM Richard Smith via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: rsmith >> Date: Wed Sep 4 18:23:47 2019 >&g

Re: [PATCH] D66361: Improve behavior in the case of stack exhaustion.

2019-09-06 Thread Richard Smith via cfe-commits
On Tue, 3 Sep 2019 at 17:59, Kamil Rytarowski via Phabricator via cfe-commits wrote: > krytarowski added a comment. > > In D66361#1656037 , @rsmith > wrote: > > > In D66361#1655903 , > @krytarowski wrote: > > > > >

r371468 - PR43242: Fix crash when typo-correcting to an operator() that should not

2019-09-09 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Sep 9 16:07:22 2019 New Revision: 371468 URL: http://llvm.org/viewvc/llvm-project?rev=371468&view=rev Log: PR43242: Fix crash when typo-correcting to an operator() that should not have been visible. Modified: cfe/trunk/lib/Sema/SemaExpr.cpp cfe/trunk/test/SemaCXX

r309503 - PR33902: Invalidate line number cache when adding more text to existing buffer.

2017-07-29 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sat Jul 29 23:31:29 2017 New Revision: 309503 URL: http://llvm.org/viewvc/llvm-project?rev=309503&view=rev Log: PR33902: Invalidate line number cache when adding more text to existing buffer. This led to crashes as the line number cache would report a bogus line number for a

Re: r309503 - PR33902: Invalidate line number cache when adding more text to existing buffer.

2017-07-29 Thread Richard Smith via cfe-commits
We should take this fix for Clang 5. On 29 July 2017 at 23:31, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith > Date: Sat Jul 29 23:31:29 2017 > New Revision: 309503 > > URL: http://llvm.org/viewvc/llvm-project?rev=309503&view=rev >

Re: r309722 - [Sema] Fix lax conversion between non ext vectors

2017-08-01 Thread Richard Smith via cfe-commits
I assume there's an implied "merge to 5.0 branch?" question here :) Yes, horrible as lax vector conversions are, we shouldn't accidentally regress support for them. On 1 August 2017 at 16:28, Hans Wennborg via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Sounds good to me. Richard, what do

Re: r308996 - [coroutines] Add serialization/deserialization of coroutines

2017-08-02 Thread Richard Smith via cfe-commits
On 31 July 2017 at 09:11, Hans Wennborg via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Richard, Gor asked for this to be merged to 5.0. What do you think? Sounds good to me. On Tue, Jul 25, 2017 at 11:01 AM, Gor Nishanov via cfe-commits > wrote: > > Author: gornishanov > > Date: Tue Ju

r309975 - Don't emit undefined-internal warnings for CXXDeductionGuideDecls.

2017-08-03 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Aug 3 12:24:27 2017 New Revision: 309975 URL: http://llvm.org/viewvc/llvm-project?rev=309975&view=rev Log: Don't emit undefined-internal warnings for CXXDeductionGuideDecls. Patch by ~paul (cynecx on phabricator)! Some test massaging by me. Added: cfe/trunk/docs/Mod

Re: [PATCH] D24933: Enable configuration files in clang

2017-08-06 Thread Richard Smith via cfe-commits
would try implementing it is a separate patch. > I can see reasonable arguments both ways here. My first impression is that keeping --config and --target separate seems like the simpler model. If we combine them, it seems like it could be difficult to set up cases like "use the config

r310401 - PR19668, PR23034: Fix handling of move constructors and deleted copy

2017-08-08 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Aug 8 12:12:28 2017 New Revision: 310401 URL: http://llvm.org/viewvc/llvm-project?rev=310401&view=rev Log: PR19668, PR23034: Fix handling of move constructors and deleted copy constructors when deciding whether classes should be passed indirectly. This fixes ABI differen

Re: r310401 - PR19668, PR23034: Fix handling of move constructors and deleted copy

2017-08-08 Thread Richard Smith via cfe-commits
I forgot to say: Based on a patch by Vassil Vassilev, which was based on a patch by Bernd Schmidt, which was based on a patch by Reid Kleckner. On 8 August 2017 at 12:12, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith > Date: Tue Aug 8 12:12:2

Re: r310605 - [Modules] Prevent #import to reenter header if not building a module.

2017-08-10 Thread Richard Smith via cfe-commits
On 10 August 2017 at 10:42, Hans Wennborg via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Sounds good to me. > > Richard, what do you think? > > On Thu, Aug 10, 2017 at 9:38 AM, Bruno Cardoso Lopes > wrote: > > Hi Hans, can we please get this merged into 5.0? > > > > Thanks, > > > > On Thu

Re: r310576 - [Lexer] Finding beginning of token with escaped new line

2017-08-10 Thread Richard Smith via cfe-commits
On 10 August 2017 at 03:06, Alexander Kornienko via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: alexfh > Date: Thu Aug 10 03:06:16 2017 > New Revision: 310576 > > URL: http://llvm.org/viewvc/llvm-project?rev=310576&view=rev > Log: > [Lexer] Finding beginning of token with escaped ne

Re: r309569 - Fix -Wshadow false positives with function-local classes.

2017-08-10 Thread Richard Smith via cfe-commits
Seems reasonable to me. On 10 August 2017 at 14:28, Hans Wennborg via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Should we merge this to 5.0? > > On Mon, Jul 31, 2017 at 8:21 AM, Alexander Kornienko via cfe-commits > wrote: > > Author: alexfh > > Date: Mon Jul 31 08:21:26 2017 > > New Re

r310691 - PR33489: A function-style cast to a deduced class template specialization type is type-dependent if it can't be resolved due to a type-dependent argument.

2017-08-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Aug 10 19:04:19 2017 New Revision: 310691 URL: http://llvm.org/viewvc/llvm-project?rev=310691&view=rev Log: PR33489: A function-style cast to a deduced class template specialization type is type-dependent if it can't be resolved due to a type-dependent argument. Modified

Re: r310691 - PR33489: A function-style cast to a deduced class template specialization type is type-dependent if it can't be resolved due to a type-dependent argument.

2017-08-10 Thread Richard Smith via cfe-commits
Hi Hans, this fixes a bug you wanted to treat as a 5.0 release blocker, so should be ported to the branch :) On 10 August 2017 at 19:04, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith > Date: Thu Aug 10 19:04:19 2017 > New Revision: 31069

r310692 - PR33850: Update cxx_dr_status for Clang 5 branch.

2017-08-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Aug 10 20:14:20 2017 New Revision: 310692 URL: http://llvm.org/viewvc/llvm-project?rev=310692&view=rev Log: PR33850: Update cxx_dr_status for Clang 5 branch. Modified: cfe/trunk/test/CXX/drs/dr20xx.cpp cfe/trunk/test/CXX/drs/dr4xx.cpp cfe/trunk/www/cxx_dr_stat

r310693 - Update cxx_status to mention the upcoming Clang 5 release.

2017-08-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Aug 10 20:16:11 2017 New Revision: 310693 URL: http://llvm.org/viewvc/llvm-project?rev=310693&view=rev Log: Update cxx_status to mention the upcoming Clang 5 release. Modified: cfe/trunk/www/cxx_status.html Modified: cfe/trunk/www/cxx_status.html URL: http://llvm.or

r310694 - Implement latest feature test macro recommendations, P0096R4.

2017-08-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Aug 10 20:39:40 2017 New Revision: 310694 URL: http://llvm.org/viewvc/llvm-project?rev=310694&view=rev Log: Implement latest feature test macro recommendations, P0096R4. Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp cfe/trunk/test/Lexer/cxx-features.cpp

Re: r310694 - Implement latest feature test macro recommendations, P0096R4.

2017-08-10 Thread Richard Smith via cfe-commits
Hi Hans, this should go onto the Clang 5 branch. Thanks! On 10 August 2017 at 20:39, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith > Date: Thu Aug 10 20:39:40 2017 > New Revision: 310694 > > URL: http://llvm.org/viewvc/llvm-project?rev=

Re: r310605 - [Modules] Prevent #import to reenter header if not building a module.

2017-08-11 Thread Richard Smith via cfe-commits
On 11 August 2017 at 16:51, Bruno Cardoso Lopes via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On Thu, Aug 10, 2017 at 5:36 PM, Richard Smith > wrote: > > On 10 August 2017 at 10:42, Hans Wennborg via cfe-commits > > wrote: > >> > >> Sounds

Re: r310706 - [modules] Set the lexical DC for dummy tag decls that refer to hidden

2017-08-11 Thread Richard Smith via cfe-commits
On 11 August 2017 at 17:20, Bruno Cardoso Lopes via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Hi Alex, > > On Fri, Aug 11, 2017 at 9:06 AM, Alex Lorenz via cfe-commits > wrote: > > Author: arphaman > > Date: Fri Aug 11 05:06:52 2017 > > New Revision: 310706 > > > > URL: http://llvm.org/v

r310776 - PR34163: Don't cache an incorrect key function for a class if queried between

2017-08-11 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Aug 11 18:46:03 2017 New Revision: 310776 URL: http://llvm.org/viewvc/llvm-project?rev=310776&view=rev Log: PR34163: Don't cache an incorrect key function for a class if queried between the class becoming complete and its inline methods being parsed. This replaces the hac

Re: r310776 - PR34163: Don't cache an incorrect key function for a class if queried between

2017-08-11 Thread Richard Smith via cfe-commits
Hi Hans, I'd like to get this into Clang 5, but it's not entirely risk-free. Perhaps we could leave it in the tree for a little while and then merge if it seems OK? On 11 August 2017 at 18:46, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith

r310803 - [c++2a] Treat 'concept' and 'requires' as keywords, add compat warning for C++17 and before.

2017-08-13 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Aug 13 14:32:33 2017 New Revision: 310803 URL: http://llvm.org/viewvc/llvm-project?rev=310803&view=rev Log: [c++2a] Treat 'concept' and 'requires' as keywords, add compat warning for C++17 and before. Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td cf

r310804 - Replace remaining user-visible mentions of C++1z with C++17.

2017-08-13 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Aug 13 15:26:53 2017 New Revision: 310804 URL: http://llvm.org/viewvc/llvm-project?rev=310804&view=rev Log: Replace remaining user-visible mentions of C++1z with C++17. Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td cfe/trunk/include/clang/Basic/Diagn

Re: r310804 - Replace remaining user-visible mentions of C++1z with C++17.

2017-08-13 Thread Richard Smith via cfe-commits
Since we took the -std=c++17 change for Clang 5, we should take this one too. On 13 August 2017 at 15:26, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith > Date: Sun Aug 13 15:26:53 2017 > New Revision: 310804 > > URL: http://llvm.org/vi

r310805 - Rename cxx1z -> cxx17 across all diagnostic IDs.

2017-08-13 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Aug 13 16:37:29 2017 New Revision: 310805 URL: http://llvm.org/viewvc/llvm-project?rev=310805&view=rev Log: Rename cxx1z -> cxx17 across all diagnostic IDs. Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td cfe/trunk/include/clang/Basic/DiagnosticParse

<    7   8   9   10   11   12   13   14   15   16   >