[clang] [clang] Add -Wimplicit-fallthrough to -Wextra (PR #97926)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I'm pretty sure I enabled the warning correctly. @AaronBallman are we good to > land? Not quite -- it looks like this change is causing libc++ test failures that were caught by precommit CI: ``` # |

[clang] [clang] Add -Wimplicit-fallthrough to -Wextra (PR #97926)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I'm not seeing any compile time impact from dropping the `DefaultIgnore`s on > warn_unannotated_fallthrough/warn_unannotated_fallthrough_per_function. So > either it's free or I'm still doing something wrong. >

[clang] [AIX] Detect `#pragma mc_func` (PR #99888)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I have not reviewed other pragmas that we do not support, but I think this > one is a bit special in that it defines functions (code) that can be > executed, and we are aware of use cases where detecting the error at link > time is insufficient. Ooh, maybe I

[clang] [ASTMatchers] Extend hasName matcher when matching templates (PR #100349)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > @AaronBallman That's a good point, I didn't account for how defaulted > > > template arguments aren't printed. Would using `<*>` ~or a more rustic > > > approach of `<_>`~ be a good alternative? > > > > > > I was thinking about that, but I keep coming around to

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: There is discussion on the Core reflectors about this DR (https://lists.isocpp.org/core/2024/07/16028.php), so given the amount of difficulty we've had with this DR so far, I would recommend we hold off on landing any changes until Core has finished deliberation.

[clang] [clang][Sema] Refine unused-member-function diagnostic message for constructors (PR #84515)

2024-07-25 Thread Aaron Ballman via cfe-commits
@@ -402,7 +402,7 @@ def warn_unused_function : Warning<"unused function %0">, InGroup, DefaultIgnore; def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">, InGroup, DefaultIgnore; -def warn_unused_member_function : Warning<"unused member

[clang] [clang][Sema] Refine unused-member-function diagnostic message for constructors (PR #84515)

2024-07-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/84515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Refine unused-member-function diagnostic message for constructors (PR #84515)

2024-07-25 Thread Aaron Ballman via cfe-commits
@@ -76,10 +76,33 @@ struct S { struct SVS : public VS { void vm() { } }; + + struct CS { AaronBallman wrote: When switching the diagnostic approach, be sure to add test coverage for unused copy/move constructors, copy/move assignment, and

[clang] [clang][Sema] Refine unused-member-function diagnostic message for constructors (PR #84515)

2024-07-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for the diagnostic improvement! https://github.com/llvm/llvm-project/pull/84515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] replaced the usage of `asctime` with `std::put_time` (PR #99075)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Blech, thank you for trying! I guess that unless there's some way to hide this ugliness in the cmake scripts or someone else has better ideas to try, the `asm` aliasing (on Solaris only) may be our best path forward. https://github.com/llvm/llvm-project/pull/99075

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Should we prefix this with `__builtin_` as mentioned in https://github.com/llvm/llvm-project/issues/98310#issuecomment-2221105713 ? https://github.com/llvm/llvm-project/pull/99473 ___ cfe-commits mailing list

[clang] [Clang] fix assertion failure in invalid delete operator declaration check (PR #99308)

2024-07-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/99308 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] fix assertion failure in invalid delete operator declaration check (PR #99308)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman If no further feedback is needed, could you please proceed with > the merge? Thanks Can do! Btw, you should feel free to obtain commit privileges yourself if you'd like: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access

[clang] [Clang] fix assertion failure in invalid delete operator declaration check (PR #99308)

2024-07-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! Thank you for the fix! https://github.com/llvm/llvm-project/pull/99308 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] replaced the usage of `asctime` with `std::put_time` (PR #99075)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > We have a mixture of both `std::tm` and `::tm` in here, try switching to > > using `::tm` and see if that helps. > > Unfortunately not: I always get the undefined reference to the `std::tm const > *` version, no matter what I tried. Drat! If you dump the symbols from

[clang] [ASTMatchers] Extend hasName matcher when matching templates (PR #100349)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Allow users to match all record instantiations by using <> as a wildcard. I think this will change the behavior of existing matchers, consider: ``` template struct S { Ty Val; void Call(); }; int main() { S<> s; s.Call(); // Currently matches only this S

[clang] [ASTMatchers] Extend hasName matcher when matching templates (PR #100349)

2024-07-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/100349 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] replaced the usage of `asctime` with `std::put_time` (PR #99075)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Aha! https://bugs.llvm.org/show_bug.cgi?id=33767 We have a mixture of both `std::tm` and `::tm` in here, try switching to using `::tm` and see if that helps. https://github.com/llvm/llvm-project/pull/99075 ___ cfe-commits

[clang] [clang] replaced the usage of `asctime` with `std::put_time` (PR #99075)

2024-07-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Confirmed: reverting the change locally restores the builds, although I don't > yet see why. The fact that there's a missing symbol suggests the STL on the machine is not conforming... the symbol that's missing

[clang] [clang] Implement `__is_virtual_base_of()` intrinsic (PR #100393)

2024-07-24 Thread Aaron Ballman via cfe-commits
@@ -6027,6 +6027,33 @@ static bool EvaluateBinaryTypeTrait(Sema , TypeTrait BTT, const TypeSourceI return cast(rhsRecord->getDecl()) ->isDerivedFrom(cast(lhsRecord->getDecl())); } + case BTT_IsVirtualBaseOf: { +const RecordType *BaseRecord = LhsT->getAs(); +

[clang] [clang] Implement `__is_virtual_base_of()` intrinsic (PR #100393)

2024-07-24 Thread Aaron Ballman via cfe-commits
@@ -6027,6 +6027,33 @@ static bool EvaluateBinaryTypeTrait(Sema , TypeTrait BTT, const TypeSourceI return cast(rhsRecord->getDecl()) ->isDerivedFrom(cast(lhsRecord->getDecl())); } + case BTT_IsVirtualBaseOf: { +const RecordType *BaseRecord = LhsT->getAs(); +

[clang] [clang] Implement `__is_virtual_base_of()` intrinsic (PR #100393)

2024-07-24 Thread Aaron Ballman via cfe-commits
@@ -6027,6 +6027,33 @@ static bool EvaluateBinaryTypeTrait(Sema , TypeTrait BTT, const TypeSourceI return cast(rhsRecord->getDecl()) ->isDerivedFrom(cast(lhsRecord->getDecl())); } + case BTT_IsVirtualBaseOf: { +const RecordType *BaseRecord = LhsT->getAs(); +

[clang] [clang] Implement `__is_virtual_base_of()` intrinsic (PR #100393)

2024-07-24 Thread Aaron Ballman via cfe-commits
@@ -6027,6 +6027,33 @@ static bool EvaluateBinaryTypeTrait(Sema , TypeTrait BTT, const TypeSourceI return cast(rhsRecord->getDecl()) ->isDerivedFrom(cast(lhsRecord->getDecl())); } + case BTT_IsVirtualBaseOf: { +const RecordType *BaseRecord = LhsT->getAs(); +

[clang] [clang] Implement `__is_virtual_base_of()` intrinsic (PR #100393)

2024-07-24 Thread Aaron Ballman via cfe-commits
@@ -6027,6 +6027,33 @@ static bool EvaluateBinaryTypeTrait(Sema , TypeTrait BTT, const TypeSourceI return cast(rhsRecord->getDecl()) ->isDerivedFrom(cast(lhsRecord->getDecl())); } + case BTT_IsVirtualBaseOf: { +const RecordType *BaseRecord = LhsT->getAs(); +

[clang] [clang] Define `ATOMIC_FLAG_INIT` correctly for C++. (PR #97534)

2024-07-24 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > @AaronBallman Just FYI you can also add the Milestone to the PR directly > > and use the /cherry-pick command right here. This is a bit simpler. > > That's good to know! I was going off the documentation at: >

[clang] [clang] Define `ATOMIC_FLAG_INIT` correctly for C++. (PR #97534)

2024-07-24 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman Just FYI you can also add the Milestone to the PR directly and > use the /cherry-pick command right here. This is a bit simpler. That's good to know! I was going off the documentation at:

[clang] [clang-tools-extra] thread-safety: Support the new capability-based names for all related attributes. (PR #99919)

2024-07-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for these changes! Can you also add a release note to `clang/docs/ReleaseNotes.rst` so users know about the new attribute spellings? https://github.com/llvm/llvm-project/pull/99919 ___ cfe-commits

[clang] [clang-tools-extra] thread-safety: Support the new capability-based names for all related attributes. (PR #99919)

2024-07-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/99919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] thread-safety: Support the new capability-based names for all related attributes. (PR #99919)

2024-07-24 Thread Aaron Ballman via cfe-commits
@@ -77,15 +77,15 @@ CoroutineHostileRAIICheck::CoroutineHostileRAIICheck(StringRef Name, void CoroutineHostileRAIICheck::registerMatchers(MatchFinder *Finder) { // A suspension happens with co_await or co_yield. - auto ScopedLockable =

[clang] [ExprConstant] Handle shift overflow the same way as other kinds of overflow (PR #99579)

2024-07-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/99579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Update argument checking tablegen code to use a 'full' name (PR #99993)

2024-07-24 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > Does this impact anything user-facing? e.g., should there be an additional > > test somewhere in clang/test/Sema/ for this change? > > I don't think there is any user-visible issue with the one attribute that > uses this. Thanks! > At least how the Parse code is

[clang] [clang][Driver] Add flag for setting SkipFunctionBodies (PR #100135)

2024-07-24 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,13 @@ +// Trivial check to ensure skip-function-bodies flag is propagated. +// +// RUN: %clang_cc1 -verify -skip-function-bodies -pedantic-errors %s +// expected-no-diagnostics + +int f() { + // normally this should emit some diags, but we're skipping it! + this is

[clang] [clang][Driver] Add flag for setting SkipFunctionBodies (PR #100135)

2024-07-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/100135 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver] Add flag for setting SkipFunctionBodies (PR #100135)

2024-07-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/100135 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Define `ATOMIC_FLAG_INIT` correctly for C++. (PR #97534)

2024-07-24 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I think this should be picked for the Clang 19 branch, so I filed https://github.com/llvm/llvm-project/issues/100362 https://github.com/llvm/llvm-project/pull/97534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Define `ATOMIC_FLAG_INIT` correctly for C++. (PR #97534)

2024-07-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/97534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Don't mark VarDecls of bindings in tuple-like decompositions as implicit (PR #100355)

2024-07-24 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: CC @zygoloid for design opinions. This holding variable is really weird in that it's both not spelled in source (the user doesn't give it a name) but is spelled in source (only exists because of a source construct). I think that makes it hard to know whether it should or

[clang] [clang][headers] Including stddef.h always redefines NULL (PR #99727)

2024-07-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. > The Driver/linker-wrapper-passes.c test failure doesn't look related, that > test doesn't use stddef.h or anything else. I keep trying to rebase to make > it go away but it's stubborn. I looked at the failures as well and I think

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. Thank you, the changes LGTM assuming precommit CI doesn't discover anything. @cor3ntin are you happy with the changes as well? https://github.com/llvm/llvm-project/pull/99075 ___ cfe-commits

[clang] [ASTContext] Make the end of the switch case unreachable in `encodeTypeForFunctionPointerAuth` (PR #99763)

2024-07-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/99763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][headers] Including stddef.h always redefines NULL (PR #99727)

2024-07-23 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman Should this be added to the 19.x milestone and cherry-picked? I think it should be https://github.com/llvm/llvm-project/pull/99727 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Assume the result of 'fopen' can't alias with 'std{in,out,err}' (PR #100085)

2024-07-23 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman You are technically right. But it makes more sense to assume > they don't alias. Luckily, in CSA, we don't need to be perfect, and covering > the generic scenario usually leads to better user experience. > > That said, I'll add the example you suggested.

[clang] [clang] Define `ATOMIC_FLAG_INIT` correctly for C++. (PR #97534)

2024-07-23 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Btw, do you need someone to merge this on your behalf? https://github.com/llvm/llvm-project/pull/97534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Define `ATOMIC_FLAG_INIT` correctly for C++. (PR #97534)

2024-07-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/97534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver] Add flag for setting SkipFunctionBodies (PR #100135)

2024-07-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: My initial thinking was that this doesn't scale particularly well as there may be other options we want to also set at the same time to help produce a reproducer. But after looking through the existing options, I don't really see others that don't

[clang] [clang] Update argument checking tablegen code to use a 'full' name (PR #99993)

2024-07-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: > Also fix a bug in the StrictEnumParameters tablegen. If will now correctly > specify each parameter instead of only the first. Does this impact anything user-facing? e.g., should there be an additional test somewhere in clang/test/Sema/ for this

[clang] [clang] Update argument checking tablegen code to use a 'full' name (PR #99993)

2024-07-23 Thread Aaron Ballman via cfe-commits
@@ -153,6 +153,40 @@ std::string AttributeCommonInfo::getNormalizedFullName() const { normalizeName(getAttrName(), getScopeName(), getSyntax())); } +static StringRef getSyntaxName(AttributeCommonInfo::Syntax SyntaxUsed) { + switch (SyntaxUsed) { + case

[clang] [clang] Update argument checking tablegen code to use a 'full' name (PR #99993)

2024-07-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/3 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Zero init unspecified fields in initializers in C (#97459) (PR #97121)

2024-07-23 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Ping @rjmccall @efriedma-quic -- I'd like to see this get into the release so that the Linux kernel can be built with Clang 19. https://github.com/llvm/llvm-project/pull/97121 ___ cfe-commits mailing list

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. Changes LGTM, I've added @MaskRay and @jansvoboda11 in case they can help answer the OpenCL questions, as it seems @AnastasiaStulova may be unavailable at the moment. If we don't hear back from anyone in the next two days, I think

[clang] [clang][headers] Including stddef.h always redefines NULL (PR #99727)

2024-07-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: With additional test coverage, the changes LGTM but I'd appreciate it if @zygoloid or @ChuanqiXu9 could validate the modules logic. https://github.com/llvm/llvm-project/pull/99727 ___ cfe-commits mailing

[clang] [clang][headers] Including stddef.h always redefines NULL (PR #99727)

2024-07-22 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > These changes should come with a release note so users know about the fix. > > Does it need a release note? It was introduced in 19 with #90676, and this > will fix it in 19 too. Ah nope, no need for a release note then! https://github.com/llvm/llvm-project/pull/99727

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-22 Thread Aaron Ballman via cfe-commits
@@ -1721,11 +1721,13 @@ void Preprocessor::ExpandBuiltinMacro(Token ) { Diag(Tok.getLocation(), diag::warn_pp_date_time); // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned by

[clang] [ASTContext] Add a break to nested switch in `encodeTypeForFunctionPointerAuth` (PR #99763)

2024-07-22 Thread Aaron Ballman via cfe-commits
@@ -3363,6 +3363,7 @@ static void encodeTypeForFunctionPointerAuth(const ASTContext , #include "clang/Basic/RISCVVTypes.def" llvm_unreachable("not yet implemented"); } +break; AaronBallman wrote: My thinking was: if we add the

[clang] [clang][headers] Including stddef.h always redefines NULL (PR #99727)

2024-07-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: These changes should come with a release note so users know about the fix. https://github.com/llvm/llvm-project/pull/99727 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][headers] Including stddef.h always redefines NULL (PR #99727)

2024-07-22 Thread Aaron Ballman via cfe-commits
@@ -20,19 +20,18 @@ * modules. */ #if defined(__MVS__) && __has_include_next() -#include <__stdarg_header_macro.h> #undef __need___va_list #undef __need_va_list #undef __need_va_arg #undef __need___va_copy #undef __need_va_copy +#include <__stdarg_header_macro.h>

[clang] [clang][headers] Including stddef.h always redefines NULL (PR #99727)

2024-07-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/99727 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

2024-07-22 Thread Aaron Ballman via cfe-commits
@@ -1721,11 +1721,13 @@ void Preprocessor::ExpandBuiltinMacro(Token ) { Diag(Tok.getLocation(), diag::warn_pp_date_time); // MSVC, ICC, GCC, VisualAge C++ extension. The generated string should be // of the form "Ddd Mmm dd hh::mm::ss ", which is returned by

[clang] Handle constant "pointers" for `__atomic_always_lock_free`/`__atomic_is_lock_free`. (PR #99340)

2024-07-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM but please add a release note when landing so users know about the changes. https://github.com/llvm/llvm-project/pull/99340 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Handle constant "pointers" for `__atomic_always_lock_free`/`__atomic_is_lock_free`. (PR #99340)

2024-07-22 Thread Aaron Ballman via cfe-commits
@@ -124,6 +124,24 @@ _Static_assert(__atomic_always_lock_free(4, ), ""); _Static_assert(!__atomic_always_lock_free(8, ), ""); _Static_assert(__atomic_always_lock_free(8, ), ""); +// Validate use with fake pointers constants. This mechanism is used to allow +// validating

[clang] [ASTContext] Add a break to nested switch in `encodeTypeForFunctionPointerAuth` (PR #99763)

2024-07-22 Thread Aaron Ballman via cfe-commits
@@ -3363,6 +3363,7 @@ static void encodeTypeForFunctionPointerAuth(const ASTContext , #include "clang/Basic/RISCVVTypes.def" llvm_unreachable("not yet implemented"); } +break; AaronBallman wrote: It would crash anyway if we fell through because

[clang] [SPARC][clang] Add -m(no-)v8plus flags handling (PR #98713)

2024-07-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: The changes LGTM as far as they go, but I've added the driver and options code owners just to make sure they're also happy. https://github.com/llvm/llvm-project/pull/98713 ___ cfe-commits mailing list

[clang] [ASTContext] Add a break to nested switch in `encodeTypeForFunctionPointerAuth` (PR #99763)

2024-07-22 Thread Aaron Ballman via cfe-commits
@@ -3363,6 +3363,7 @@ static void encodeTypeForFunctionPointerAuth(const ASTContext , #include "clang/Basic/RISCVVTypes.def" llvm_unreachable("not yet implemented"); } +break; AaronBallman wrote: Does inserting an `llvm_unreachable()` here work

[clang] [clang] Define ATOMIC_FLAG_INIT correctly for C++. (PR #97534)

2024-07-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/97534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Define ATOMIC_FLAG_INIT correctly for C++. (PR #97534)

2024-07-22 Thread Aaron Ballman via cfe-commits
@@ -750,6 +750,8 @@ Bug Fixes in This Version - Fixed `static_cast` to array of unknown bound. Fixes (#GH62863). +- Fixed the definition of ATOMIC_FLAG_INIT in stdatomic.h so it can be used in C++. AaronBallman wrote: ```suggestion - Fixed the definition

[clang] [clang] Define ATOMIC_FLAG_INIT correctly for C++. (PR #97534)

2024-07-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for catching this! Can you also add some tests to `clang/test/Headers/`? We have some coverage for stdatomic.h in C, but not in C++ (I'd recommend trying to add a `RUN` line to the .c file with `-x c++` so it's tested in C++ mode and then

[clang] Fix assertion failure during conversion function overload resolution. (PR #98671)

2024-07-22 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: CC @zygoloid for a potential additional set of eyes https://github.com/llvm/llvm-project/pull/98671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose use of deprecated template alias (PR #97619)

2024-07-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/97619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix issue https://github.com/llvm/llvm-project/issues/98018. (PR #99672)

2024-07-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/99672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix issue https://github.com/llvm/llvm-project/issues/98018. (PR #99672)

2024-07-22 Thread Aaron Ballman via cfe-commits
@@ -8208,7 +8208,8 @@ void Sema::CheckInfNaNFunction(const CallExpr *Call, << 1 << 0 << Call->getSourceRange(); else if ((IsStdFunction(FDecl, "isinf") || (IsStdFunction(FDecl, "isfinite") || - (FDecl->getIdentifier() && FDecl->getName() ==

[clang] Fix issue https://github.com/llvm/llvm-project/issues/98018. (PR #99672)

2024-07-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Please update the patch title and description to describe what changes the patch is making rather than just linking to an issue. https://github.com/llvm/llvm-project/pull/99672 ___ cfe-commits mailing list

[clang] [Clang] Fix handling of qualified id-expressions in unevaluated contexts (PR #99807)

2024-07-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, thank you for the fix! https://github.com/llvm/llvm-project/pull/99807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Disallow applying `onwership_returns` to functions that return non-pointers (PR #99564)

2024-07-19 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Adding the static analysis code owners for input. Also, precommit CI found a valid failure: ``` FAIL: Clang :: AST/attr-print-emit.cpp (400 of 20466) TEST 'Clang :: AST/attr-print-emit.cpp' FAILED Exit Code: 1 Command Output

[clang] [clang] Emit bad shift warnings (PR #70307)

2024-07-19 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > @alanzhao1 do you think it's reasonable for the workaround to only apply > > > to code in system headers, or does the NDK get included as regular > > > headers generally? > > > > > > Having it only apply to system headers should be OK - in our case, chrome > >

[clang] [ExprConstant] Handle shift overflow the same way as other kinds of overflow (PR #99579)

2024-07-19 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this! In general, this is heading in the right direction. Though I do agree with @shafik that it would be nice to add additional test coverage for the changes which didn't modify existing test behavior. Also, we should have a

[clang] [ExprConstant] Handle shift overflow the same way as other kinds of overflow (PR #99579)

2024-07-19 Thread Aaron Ballman via cfe-commits
@@ -142,7 +142,7 @@ constexpr int arb(int n) { // expected-note {{declared here}} expected-note {{function parameter 'n' with unknown value cannot be used in a constant expression}} } constexpr long Overflow[(1 << 30) << 2]{}; // expected-warning {{requires 34

[clang] [ExprConstant] Handle shift overflow the same way as other kinds of overflow (PR #99579)

2024-07-19 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/99579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose use of deprecated template alias (PR #97619)

2024-07-19 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/97619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix underlying type of EmbedExpr (PR #99050)

2024-07-19 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/99050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix a regression with alignas on structure members in C (PR #98642)

2024-07-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/98642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix a regression with alignas on structure members in C (PR #98642)

2024-07-18 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Thanks, LGTM. I like this version. Thank you for the excellent review, I think we came to a better approach in the end! > Did this change also fix any other bugs? Since it looks like we were > previously not skipping ProcessDeclAttribute for `[[]]` attributes in C23 >

[clang] Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (PR #97342)

2024-07-18 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Ping @AnastasiaStulova for OpenCL feedback (this PR impacts an OpenCL command line option). https://github.com/llvm/llvm-project/pull/97342 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Handle constant "pointers" for `__atomic_always_lock_free`/`__atomic_is_lock_free`. (PR #99340)

2024-07-18 Thread Aaron Ballman via cfe-commits
@@ -124,6 +124,24 @@ _Static_assert(__atomic_always_lock_free(4, ), ""); _Static_assert(!__atomic_always_lock_free(8, ), ""); _Static_assert(__atomic_always_lock_free(8, ), ""); +// Validate use with fake pointers constants. This mechanism is used to allow +// validating

[clang] [clang] pointer to member with qualified-id enclosed in parentheses in unevaluated context should be invalid (PR #89713)

2024-07-18 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I can try to look at that this week. Either way be ill-formed is much better > than being incorrect Thank you @cor3ntin! If it looks like you won't have a solution by Monday sometime, let's revert the changes so they don't end up on the release branch. We can

[clang] Improve stack usage to increase recursive initialization depth (PR #88546)

2024-07-18 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman ping I've not been able to get back on to this, unfortunately. I'm not certain when I'll have time, either. https://github.com/llvm/llvm-project/pull/88546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Emit bad shift warnings (PR #70307)

2024-07-18 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Just to confirm: is this the intentional outcome of this patch? Before C++20, left shift of -1 does not produce a mathematical result that's within the range of representable values for the result type, so it's undefined behavior, and therefore not a core constant

[clang] [clang] Fix static analyzer concerns in #embed code (PR #99331)

2024-07-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/99331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose use of deprecated template alias (PR #97619)

2024-07-18 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s +// +// This test checks that a deprecated attribute on an alias +// template triggers a warning diagnostic when it is used. + +template +struct NoAttr { + void foo() {} +}; + +// expected-note@+2

[clang] [clang] Diagnose use of deprecated template alias (PR #97619)

2024-07-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for this, the changes should also come with a release note in clang/docs/ReleaseNotes.rst so users know about the improvement. Changes generally LG, but I did have some test suggestions. https://github.com/llvm/llvm-project/pull/97619

[clang] [clang] Diagnose use of deprecated template alias (PR #97619)

2024-07-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/97619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Performance optimizations for function effects (nonblocking attribute etc.) (PR #96844)

2024-07-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/96844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] pointer to member with qualified-id enclosed in parentheses in unevaluated context should be invalid (PR #89713)

2024-07-17 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Thank you for spotting this, btw! Given the proximity to the branch date, I lean towards (1) to give us time to figure out how to properly do (3) unless someone is starting on (3) Real Soon Now™. Any disagreement @cor3ntin ? https://github.com/llvm/llvm-project/pull/89713

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-07-17 Thread Aaron Ballman via cfe-commits
@@ -9015,11 +9015,20 @@ bool Sema::RequireCompleteTypeImpl(SourceLocation Loc, QualType T, if (const MemberPointerType *MPTy = T->getAs()) { if (!MPTy->getClass()->isDependentType()) { - if (getLangOpts().CompleteMemberPointers && -

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-07-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: This generally LGTM but I'd love to hear from @rnk or @zmodem as they are quite knowledgeable about the MS ABI in general. https://github.com/llvm/llvm-project/pull/91990 ___ cfe-commits mailing list

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-07-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/91990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] pointer to member with qualified-id enclosed in parentheses in unevaluated context should be invalid (PR #89713)

2024-07-17 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: If I'm following along correctly, both of those `static_assert`s should be accepted from your first example because `decltype` is an unevaluated context and the fix would be to change: ``` if (isa(OrigOp.get())) { ``` to instead be: ``` if (isa(OrigOp.get()) &&

[clang] Handle constant "pointers" for `__atomic_always_lock_free`/`__atomic_is_lock_free`. (PR #99340)

2024-07-17 Thread Aaron Ballman via cfe-commits
@@ -124,6 +124,24 @@ _Static_assert(__atomic_always_lock_free(4, ), ""); _Static_assert(!__atomic_always_lock_free(8, ), ""); _Static_assert(__atomic_always_lock_free(8, ), ""); +// Validate use with fake pointers constants. This mechanism is used to allow +// validating

[clang] Handle constant "pointers" for `__atomic_always_lock_free`/`__atomic_is_lock_free`. (PR #99340)

2024-07-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thanks for this! It should probably have a release note + documentation so users know this is a supported behavior? https://github.com/llvm/llvm-project/pull/99340 ___ cfe-commits mailing list

[clang] Handle constant "pointers" for `__atomic_always_lock_free`/`__atomic_is_lock_free`. (PR #99340)

2024-07-17 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/99340 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix static analyzer concerns in #embed code (PR #99331)

2024-07-17 Thread Aaron Ballman via cfe-commits
@@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -std=c23 %s -E -verify +// RUN: %clang_cc1 -std=c23 %s -E -verify --embed-dir=%S --embed-dir=%S/Inputs +#embed AaronBallman wrote: It feels like this test is unrelated to the test name now; should we move this into its own

  1   2   3   4   5   6   7   8   9   10   >