[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a subscriber: hubert.reinterpretcast. aaron.ballman added a comment. In D136568#3880711 , @jcranmer-intel wrote: > FWIW, I would be slightly wary of relying on cppreference as definitive for > niche semantic issues like this, althoug

[PATCH] D136532: [clang][Interp] Implement left and right shifts

2022-10-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/AST/Interp/shifts.cpp:57 +//c >>= 99; // expected-warning {{shift count >= width of type}} +//c <<= CHAR_BIT; // expected-warning {{shift count >= width of type}} +//c >>= CHAR_BIT; // expected-warning {{

[PATCH] D134453: Disambiguate type names when printing NTTP types

2022-10-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D134453#3880794 , @mizvekov wrote: > In D134453#3880729 , @dblaikie > wrote: > >> I think we should restrict the discussion in this review to being only about >> the case where

[PATCH] D136532: [clang][Interp] Implement left and right shifts

2022-10-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/AST/Interp/shifts.cpp:57 +//c >>= 99; // expected-warning {{shift count >= width of type}} +//c <<= CHAR_BIT; // expected-warning {{shift count >= width of type}} +//c >>= CHAR_BIT; // expected-warning {{

[PATCH] D134453: Disambiguate type names when printing NTTP types

2022-10-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D134453#3885961 , @dblaikie wrote: >> it's up to IDE's and good editors and CI log parsers to parse that and >> present in a possibly better format. > > Lots of folks use the diagnostic info from their compiler without I

[PATCH] D136737: [Draft] [clang] Add builtin_unspecified_value

2022-10-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. It looks like this is missing parsing logic and test cases. Comment at: clang/include/clang-c/Index.h:1534-1539 + /** + * A clang-builtin of unspecified value. + */ + CXCursor_UnspecifiedValueExpr = 155, + + CXCursor_LastExpr = CXCursor_Uns

[PATCH] D133698: [clang][dataflow] Implement transferBranch

2022-10-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. FWIW, it looks like this change broke the AIX bot: https://lab.llvm.org/buildbot/#/builders/214/builds/3932 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133698/new/ https://reviews.llvm.org/D133698

[PATCH] D136532: [clang][Interp] Implement left and right shifts

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:1291-1305 + if (RHS.isNegative()) { const SourceInfo &Loc = S.Current->getSource(OpPC); S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt(); -return ShiftLeft(S, OpPC,

[PATCH] D134453: Disambiguate type names when printing NTTP types

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: aaron.ballman, dblaikie. aaron.ballman added a comment. Thanks! The changes are generally looking good to me. Can you add a release note about the improvement to our diagnostic behavior (in clang/docs/ReleaseNotes.rst -- there's a section for diagnostic improvement

[PATCH] D135366: [clang][Interp] Implement String- and CharacterLiterals

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM aside from a testing request. Comment at: clang/test/AST/Interp/literals.cpp:342 + static_assert(mc == 'abc', ""); + __WCHAR_TYPE__ wm = L'abc'; // ref-error{{wide character literals may not contain mu

[PATCH] D136826: [clang][Interp] Make sure we free() allocated InitMaps

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. The changes look correct to me, but you may want to wait a little bit before landing to give the other reviewers a chance to look this over given that there's no tests possible f

[PATCH] D136532: [clang][Interp] Implement left and right shifts

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136532/new/ https://reviews.llvm.org/D136532 ___ cfe-commits mailing lis

[PATCH] D136807: [clang][Sema] Fix a clang crash with btf_type_tag

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. The changes generally look good to me, but can you add a release note for the fix as well? Comment at: clang/test/Sema/attr-btf_type_tag-func-ptr.c:1 +// RUN: %clang_cc1 -x c -triple x86_64-pc-linux-gnu -dwarf-version=4 -fsyntax-only -verify %s

[PATCH] D136828: [clang][Interp] Diagnose uninitialized array record fields

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/Interp/Interp.cpp:446-448 +static void DiagnoseUninitializedSubobject(InterpState &S, const SourceInfo &SI, + QualType SubObjType, +

[PATCH] D134453: Disambiguate type names when printing NTTP types

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM assuming precommit CI comes back green. Do you need someone to land these changes on your behalf? If so, please let me know what name and email address you'd like used for p

[PATCH] D136831: [clang][Interp] Protect Record creation against infinite recusion

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136831/new/ https://reviews.llvm.org/D136831

[PATCH] D136694: [clang][Interp] Check that constructor calls initialize all record fields

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. It's worth noting that there are core issues in this area: https://wg21.link/cwg2558 and https://wg21.link/cwg2536 and they're not yet resolved. Comment at: clang/test/AST/Interp/records.cpp:276 // FIXME: This is currently not being diagnos

[PATCH] D135721: [HLSL] Added HLSL this as a reference

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for your patience while I sat and thought about this for a while. I'm not against the idea, but I've definitely got some design concerns with it which I've pointed out in the review. I think this also needs considerably more testing of the codegen and se

[PATCH] D119051: Extend the C++03 definition of POD to include defaulted functions

2022-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: clang-vendors. aaron.ballman added a comment. Adding clang-vendors because of the potential for disruption. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119051/new/ https://reviews.llvm.org/D119051

[PATCH] D136942: [C2x] Add test coverage for WG14 N2322

2022-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman created this revision. aaron.ballman added reviewers: clang-language-wg, erichkeane, jyknight. Herald added a project: All. aaron.ballman requested review of this revision. Herald added a project: clang. The changes in this paper add a new recommended practice. I had originally mark

[PATCH] D134453: Disambiguate type names when printing NTTP types

2022-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG835b99e4c838: Disambiguate type names when printing NTTP types (authored by DoDoENT, committed by aaron.ballman). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D136953: [C++20] Diagnosed invalid and reserved module names

2022-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman created this revision. aaron.ballman added reviewers: iains, urnathan, ChuanqiXu, clang-language-wg. Herald added a project: All. aaron.ballman requested review of this revision. Herald added a project: clang. [module.unit]p1 specifies that `module` and `import` are invalid component

[PATCH] D136942: [C2x] Add test coverage for WG14 N2322

2022-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 471554. aaron.ballman marked an inline comment as done. aaron.ballman added a comment. Added an additional test case. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136942/new/ https://reviews.llvm.org/D136942 Files: clang/test/C/C2x/n2322.c

[PATCH] D136942: [C2x] Add test coverage for WG14 N2322

2022-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/C/C2x/n2322.c:44 + ) == 2007); +} + erichkeane wrote: > I might suggest: > > _Static_assert(555 == __\ > LI\ > NE\ > __) > > Which, is basically exactly what the first bullet point in J.1 is trying to

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked 2 inline comments as done. aaron.ballman added a comment. In D136953#3892077 , @cor3ntin wrote: > In D136953#3892060 , @erichkeane > wrote: > >> I'll leave it to the modules experts to decide

[PATCH] D136942: [C2x] Add test coverage for WG14 N2322

2022-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. Committed in f1c9ef311fa677992798d609b0445f1d7311a8f2 (forgot to link the review with the commit message, sorry), thank you for the reviews! CHANGES SINCE LA

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 471608. aaron.ballman marked 3 inline comments as done. aaron.ballman added a comment. Updated based on review feedback and reflection. I think the standards wording here is a bit unclear as to what's intended and I had misunderstood the wording around

[PATCH] D136826: [clang][Interp] Make sure we free() allocated InitMaps

2022-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/Interp/Descriptor.cpp:46 + + Ptr += sizeof(InitMap *); for (unsigned I = 0, NE = D->getNumElems(); I < NE; ++I) { shafik wrote: > I believe `Ptr` is not longer valid b/c of `free(IM)` b/c what `Pt

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 471628. aaron.ballman marked 2 inline comments as done. aaron.ballman added a comment. Updating based on review feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136953/new/ https://reviews.llvm.org/D136953 Files: clang/docs/ReleaseNo

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaModule.cpp:241-248 + // C++2b [module.unit]p1: ... The identifiers module and import shall not + // appear as identifiers in a module-name or module-partition. All + // module-names either beginning with an id

[Diffusion] rGe4ec6ce8a75c: Clang: Add release note for defaulted-special-members-POD GCC ABI fix

2022-10-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In rGe4ec6ce8a75c208b49b163c81cda90dc7373c791#1139062 , @dblaikie wrote: > Posted, awaiting approval. Thank you! BRANCHES main Users: dblaikie (Author) https://reviews.llvm.org/r

[PATCH] D136886: [clang] ASTImporter: Fix importing of va_list types and declarations

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/Sema.cpp:452 + if (auto *ND = dyn_cast_or_null(Context.getVaListTagDecl())) { +if (auto *DC = ND->getLexicalDeclContext(); DC->isStdNamespace()) { The API changed names recently. ===

[PATCH] D136554: Implement CWG2631

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for working on this! > Immediate calls in default arguments and defaults members are not evaluated. Er, I think this meant to say "are not evaluated immediately, unlike what the misnamed term of art would suggest." ;-) > As a result of this patch, unuse

[PATCH] D136886: [clang] ASTImporter: Fix importing of va_list types and declarations

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/AST/ast-dump-overloaded-operators.cpp:27 // CHECK-NEXT: | `-ParmVarDecl {{.*}} col:19{{( imported)?}} 'E' -// CHECK-NEXT: `-FunctionDecl {{.*}} line:14:6{{( imported)?}} test 'void ()' +// CHECK-NEXT: -FunctionDecl

[PATCH] D136886: [clang] ASTImporter: Fix importing of va_list types and declarations

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/AST/ast-dump-overloaded-operators.cpp:27 // CHECK-NEXT: | `-ParmVarDecl {{.*}} col:19{{( imported)?}} 'E' -// CHECK-NEXT: `-FunctionDecl {{.*}} line:14:6{{( imported)?}} test 'void ()' +// CHECK-NEXT: -FunctionDecl

[PATCH] D136886: [clang] ASTImporter: Fix importing of va_list types and declarations

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/Sema.cpp:460-462 +Scope S(TUScope, Scope::DeclScope, getDiagnostics()); +PushDeclContext(&S, DC); +PushOnScopeChains(ND, &S); erichkeane wrote: > mizvekov wrote: > > aaron.bal

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaModule.cpp:282 + StringRef FirstComponentName = Path[0].first->getName(); + if (!getSourceManager().isInSystemHeader(Path[0].second) && + (FirstComponentName == "std" || ChuanqiXu wrote: >

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked 3 inline comments as done. aaron.ballman added a comment. In D136953#3893039 , @tschuett wrote: > Are malformed imports an issue or are they already covered? There is limit > test coverage for import. Am I missing something? > > im

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 471988. aaron.ballman marked 2 inline comments as done. aaron.ballman added a comment. Updated based on review feedback: - Fixed a typo - Clarified the release note - Added a test case for `std.foo` being reserved CHANGES SINCE LAST ACTION https://r

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked an inline comment as done. aaron.ballman added inline comments. Comment at: clang/test/Modules/reserved-names-1.cpp:25 + expected-error {{module declaration must occur at the start of the translation unit}} +export module std.foo;// e

[PATCH] D136886: [clang] ASTImporter: Fix importing of va_list types and declarations

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/Sema.cpp:460-462 +Scope S(TUScope, Scope::DeclScope, getDiagnostics()); +PushDeclContext(&S, DC); +PushOnScopeChains(ND, &S); mizvekov wrote: > aaron.ballman wrote: > > erichk

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked an inline comment as done. aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaModule.cpp:282 + StringRef FirstComponentName = Path[0].first->getName(); + if (!getSourceManager().isInSystemHeader(Path[0].second) && + (FirstComponentName

[PATCH] D137077: [Diagnostic] Clarify -Winfinite-recursion message

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman requested changes to this revision. aaron.ballman added a comment. This revision now requires changes to proceed. Thank you for the patch! However, I think this isn't an improvement to the diagnostic -- it's a cute phrase, but it doesn't help the programmer to understand what about

[PATCH] D136886: [clang] ASTImporter: Fix importing of va_list types and declarations

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/test/AST/ast-dump-overloaded-operators.cpp:27 // CHECK-NEXT: | `-ParmVarDecl {{.*}} col:19{{( imported)?}} 'E' -// CHECK-NEXT: `-Funct

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked an inline comment as done. aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaModule.cpp:282 + StringRef FirstComponentName = Path[0].first->getName(); + if (!getSourceManager().isInSystemHeader(Path[0].second) && + (FirstComponentName

[PATCH] D136554: Implement CWG2631

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/docs/ReleaseNotes.rst:507-508 ``-std=gnu++14`` to their build settings to restore the previous behaviour. +- Implemented DR2631. Invalid ``consteval`` calls in default arguments and default + member initializers are diag

[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/constant-builtins-ilogb.cpp:1 +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics hubert.reinterpretcast wrote: > There seems to be no C language test in the patch (although the

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked 9 inline comments as done. aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaModule.cpp:282 + StringRef FirstComponentName = Path[0].first->getName(); + if (!getSourceManager().isInSystemHeader(Path[0].second) && + (FirstComponentName

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 472052. aaron.ballman marked 2 inline comments as done. aaron.ballman added a comment. Updated based on review feedback. Added an additional test case, reworked the comments in one of the tests as well. CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked 2 inline comments as done. aaron.ballman added inline comments. Comment at: clang/test/Modules/reserved-names-1.cpp:33 +expected-error {{module declaration must occur at the start of the translation unit}} + +// Show that

[PATCH] D137077: [Diagnostic] Clarify -Winfinite-recursion message

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D137077#3896561 , @merrymeerkat wrote: > In D137077#3896369 , @aaron.ballman > wrote: > >> Thank you for the patch! However, I think this isn't an improvement to the >> diagnos

[PATCH] D136554: Implement CWG2631

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/AST/ExprCXX.h:1315 + // Retrieve the rewritten init expression (for an init expression containing + // immediate calls) With the top level FullExpr and ConstantExpr stripped off. + const Expr *getAdjustedRew

[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/constant-builtins-ilogb.cpp:1 +// RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics hubert.reinterpretcast wrote: > aaron.ballman wrote: > > hubert.reinterpretcast wrote: > > > Th

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaModule.cpp:282 + StringRef FirstComponentName = Path[0].first->getName(); + if (!getSourceManager().isInSystemHeader(Path[0].second) && + (FirstComponentName == "std" || philnik wrote: > a

[PATCH] D137020: [clang][AST] Handle variable declaration with unknown typedef in C

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: clang-language-wg, aaron.ballman. aaron.ballman added a comment. Thank you for the changes! One thing you should add is a release note so users know there's been a diagnostic improvement. Comment at: clang/lib/Parse/ParseDecl.cpp:5384-5385 +boo

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaModule.cpp:282 + StringRef FirstComponentName = Path[0].first->getName(); + if (!getSourceManager().isInSystemHeader(Path[0].second) && + (FirstComponentName == "std" || philnik wrote: > a

[PATCH] D136790: [Clang][Sema] Add -Wincompatible-function-pointer-types-strict

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for the new diagnostic, please be sure to add a release note so users know there's a new warning. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8217 + err_typecheck_convert_incompatible_function_pointer.Text>, + InGroup

[PATCH] D136554: Implement CWG2631

2022-10-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I'm still thinking about the implementation, but I think this is heading in the correct direction. Comment at: clang/lib/AST/ExprCXX.cpp:970-973 +const Expr *CXXDefaultArgExpr::getExpr() const { + return CXXDefaultArgExprBits.HasRewrittenInit ?

[PATCH] D137071: [clang][Interp] Implement missing compound assign operators

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/AST/Interp/literals.cpp:553 + static_assert(IntRem(2, 1) == 0, ""); + static_assert(IntRem(9, 7) == 2, ""); + ``` static_assert(IntRem(9, 0) == 12, ""); // Not constexpr static_assert(IntRem(__INT_MIN_

[PATCH] D136790: [Clang][Sema] Add -Wincompatible-function-pointer-types-strict

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8217 + err_typecheck_convert_incompatible_function_pointer.Text>, + InGroup>, DefaultIgnore; def ext_typecheck_convert_discards_qualifiers : ExtWarn< samitolvane

[PATCH] D136554: Implement CWG2631

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Sema/Sema.h:9602-9604 +return Ctx.Context == + ExpressionEvaluationContext::PotentiallyEvaluatedIfUsed || + Ctx.IsCheckingDefaultArgumentOrInitializer; Hmm, it'd be n

[PATCH] D136554: Implement CWG2631

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:5927 + bool VisitSourceLocExpr(SourceLocExpr *E) { +HasImmediateCalls = true; +return RecursiveASTVisitor::VisitStmt(E); aaron.ballman wrote: > It may be worth a comment that th

[PATCH] D136975: [Concepts] Correctly handle failure when checking concepts recursively

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/docs/ReleaseNotes.rst:272 +- Fix a number of recursively-instantiated constraint issues, which would possibly + result in clang's stack-exhaustion. + `Issue 44304 `_ -

[PATCH] D136975: [Concepts] Correctly handle failure when checking concepts recursively

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaConcept.cpp:150 +namespace { +struct SatisfactionStackRAII { + Sema &SemaRef; erichkeane wrote: > aaron.ballman wrote: > > Er, it'd be nice for this not to shadow the name of the class from `Sem

[PATCH] D137082: [clang][Interp] Fix dereferencing arrays with no offset applied

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. > There is a difference between a Pointer and a "Pointer to the first element > of an array". I'm pretty confused because this statement is false per the language standard (http://eel.is/c++draft/expr.sub#2). Basically, array subscripting works through pointer ar

[PATCH] D136807: [clang][Sema] Fix a clang crash with btf_type_tag

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/docs/ReleaseNotes.rst:261 `Issue 47136 `_ +- Fix a crash when btf_type_tag attr is

[PATCH] D136936: [clang][Interp] Handle undefined functions better

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeEmitter.cpp:30 if (!FuncDecl->isDefined(FuncDecl) || - (!FuncDecl->hasBody() && FuncDecl->willHaveBody())) -return nullptr; + (FuncDecl->hasBody() && FuncDecl->willHaveBody())) +Has

[PATCH] D137052: [clang-format] Don't skip #else/#elif of #if 0

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Can you also add a test for `#elifdef` and `#elifndef`? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137052/new/ https://reviews.llvm.org/D137052 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaModule.cpp:282 + StringRef FirstComponentName = Path[0].first->getName(); + if (!getSourceManager().isInSystemHeader(Path[0].second) && + (FirstComponentName == "std" || philnik wrote: > a

[PATCH] D133289: [C2X] N3007 Type inference for object definitions

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for the update to this! Comment at: clang/lib/Parse/ParseExpr.cpp:1526 +// This is a temporary fix while we don't support C2x 6.5.2.5p4 +if (getLangOpts().C2x && GetLookAheadToken(2).getKind() == tok::l_brace) { + Diag(Tok,

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaModule.cpp:282 + StringRef FirstComponentName = Path[0].first->getName(); + if (!getSourceManager().isInSystemHeader(Path[0].second) && + (FirstComponentName == "std" || philnik wrote: > a

[PATCH] D136953: [C++20] Diagnose invalid and reserved module names

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I believe we now have consensus on the patch. I'll land it in a few days in case any reviewers want to weigh in now that the discussion has stabilized. Comment at: clang/lib/Sema/SemaModule.cpp:282 + StringRef FirstComponentName = Path[0].first-

[PATCH] D131657: Remove redundant condition check, NFC

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LTGM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131657/new/ https://reviews.llvm.org/D131657

[PATCH] D130894: [clang] Print more information about failed static assertions

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D130894#3715143 , @xbolva00 wrote: > In D130894#3715124 , @mstorsjo > wrote: > >> This broke building with GCC (also noted by buildbot mails): >> >> ../tools/clang/lib/Sema/Sem

[PATCH] D131194: [C++20] Fix crash-on-valid with consteval temporary construction through list initialization

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked 2 inline comments as done. aaron.ballman added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131194/new/ https://reviews.llvm.org/D131194 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[PATCH] D130894: [clang] Print more information about failed static assertions

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D130894#3715725 , @mstorsjo wrote: > In D130894#3715709 , @aaron.ballman > wrote: > >> In D130894#3715143 , @xbolva00 >> wrote: >> >>>

[PATCH] D130058: [Clang] Diagnose ill-formed constant expression when setting a non fixed enum to a value outside the range of the enumeration values

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D130058#3714880 , @glandium wrote: > In D130058#3714672 , @glandium > wrote: > >> This catches >> https://searchfox.org/mozilla-central/rev/c77834ec635c523f2ba0092fcd1728c9b1c30

[PATCH] D131479: Handle explicitly defaulted consteval special members.

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/SemaCXX/cxx2a-consteval.cpp:805 +void func() { + default_ctor fail0; // expected-error-re {{call to consteval function '{{.*::default_ctor<.*::foo>}}::default_ctor' is not a constant expression}} \ +

[PATCH] D131351: [C] Default implicit function pointer conversions diagnostic to be an error

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D131351#3714968 , @brooksmoses wrote: > For the record, so far we've seen this showing up in the following: > > - A case in a notoriously warning-heavy third-party library where we'd > backported a file from a newer ver

[PATCH] D130894: [clang] Print more information about failed static assertions

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D130894#3715884 , @xbolva00 wrote: > Btw, > > https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1697r0.html Yup, that paper is currently closed in the WG21 paper tracker FWIW. Repository: rG LLVM Github Monor

[PATCH] D119051: Extend the C++03 definition of POD to include defaulted functions

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D119051#3714645 , @dblaikie wrote: > Realized maybe we don't need a separate driver flag for this at all, and rely > only on the abi-compat flag? That seems to be how (at least some) other ABI > compat changes have been

[PATCH] D131625: [HLSL] Entry functions require param annotation

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/AST/Attr.h:193 +class HLSLAnnotationAttr : public InheritableAttr { +protected: Is this intended to be used only for parameters (that's how I read the summary for the patch)? If so, why is th

[PATCH] D131683: Diagnosing the Future Keywords

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/TokenKinds.def:395 CXX11_KEYWORD(noexcept , 0) CXX11_KEYWORD(nullptr , 0) +CXX11_KEYWORD(static_assert , KEYMSCOMPAT|KEYC23) xbolva00 wrote: > nullptr

[PATCH] D131464: [test] Make tests pass regardless of gnu++14/gnu++17 default

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D131464#3713705 , @MaskRay wrote: > It will take some time to fix all tests properly. Let's have a guideline how > to fix them properly. I tried fixing some using several patterns in the last > revision. I didn't fix al

[PATCH] D131479: Handle explicitly defaulted consteval special members.

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. Thanks, this LGTM! Please be sure to add a release note for the fix before landing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131479/new/ https://reviews.llvm.org/D131479 __

[PATCH] D131084: Add support for specifying the severity of a SARIF Result.

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/Sarif.h:157 +/// 1. https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317648";>level property +enum class SarifResultLevel { Note, Warning, Error }; + Should th

[PATCH] D131423: [clang] fix frontend crash when evaluating type trait

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D131423#3714318 , @shafik wrote: > In D131423#3712083 , @inclyc wrote: > >> @aaron.ballman @shafik (Help wanted). These type traits will not cause >> clang to crash if current p

[PATCH] D131194: [C++20] Fix crash-on-valid with consteval temporary construction through list initialization

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb48fb85fe60b: Fix crash-on-valid with consteval temporary construction through list… (authored by aaron.ballman). Changed prior to commit: https://reviews.llvm.org/D131194?vs=450271&id=451913#toc Repos

[PATCH] D131194: [C++20] Fix crash-on-valid with consteval temporary construction through list initialization

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/CodeGen/CGExprConstant.cpp:1402 +RetType = CGM.getContext().getLValueReferenceType(RetType); + assert(!RetType.isNull() && "Not certain of the constant expression's type"); + efriedma wrote: > Not su

[PATCH] D131704: [Clang] Tighten restrictions on enum out of range diagnostic

2022-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM presuming precommit CI comes back clean. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131704/new/ https://reviews.llvm.org/D131704 ___

[PATCH] D131351: [C] Default implicit function pointer conversions diagnostic to be an error

2022-08-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D131351#3718421 , @mstorsjo wrote: > I found another case of this warning, which is kinda borderline whether it > really is an error not: > > #include > static _Noreturn void my_exit(void) { > exit(42); > } >

[PATCH] D131730: __has_trivial_copy should map to __is_trivially_copyable

2022-08-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131730/new/ https://reviews.llvm.org/D131730 ___ cfe-commits mailing list cfe-comm

[PATCH] D130033: [HLSL] Add resource binding attribute for HLSL.

2022-08-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:6557-6558 +Here're resource binding examples with and without space: +``register(t3, space1)`` +``register(t1)`` +The full documentation is available here: https://docs.microsoft.com/en-us/win

[PATCH] D131255: Fix Wbitfield-constant-conversion on 1-bit signed bitfield

2022-08-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:13069 - // therefore don't strictly fit into a signed bitfield of width 1. - if (FieldWidth == 1 && Value == 1) -return false; thakis wrote: > This was to suppress false positi

[PATCH] D131084: Add support for specifying the severity of a SARIF Result.

2022-08-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/Sarif.h:157 +/// 1. https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317648";>level property +enum class SarifResultLevel { Note, Warning, Error }; + vaibhav.y

[PATCH] D116203: [clang] adds unary type transformations as compiler built-ins

2022-08-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Pre-commit CI found build errors that should be addressed. Comment at: clang/include/clang/AST/TransformTypeTraits.def:1-2 +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt

[PATCH] D131255: Fix Wbitfield-constant-conversion on 1-bit signed bitfield

2022-08-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:13069 - // therefore don't strictly fit into a signed bitfield of width 1. - if (FieldWidth == 1 && Value == 1) -return false; ShawnZhong wrote: > ShawnZhong wrote: > > ShawnZh

[PATCH] D131423: [clang] fix frontend crash when evaluating type trait

2022-08-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM, but you should add a release note for the change. Comment at: clang/lib/Basic/TypeTraits.cpp:64 +#define TYPE_TRAIT_N(Spelling, Name, Key) 0, +#include "c

[PATCH] D131351: [C] Default implicit function pointer conversions diagnostic to be an error

2022-08-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D131351#3718982 , @mstorsjo wrote: > A different but slightly similar case, where I've run into these errors too, > FWIW: On ARM, when compiling with a hardfloat target, Clang does consider a > function pointer with `__

[PATCH] D131351: [C] Default implicit function pointer conversions diagnostic to be an error

2022-08-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D131351#3718728 , @mizvekov wrote: > In D131351#3718725 , @aaron.ballman > wrote: > >> However, we don't care about the type mismatch when doing a redeclaration or >> when dropp

<    48   49   50   51   52   53   54   55   56   57   >