shafik wrote:
It looks like this PR causes a regression:
https://github.com/llvm/llvm-project/issues/150336
https://github.com/llvm/llvm-project/pull/144408
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman
@@ -14,35 +14,66 @@
#define LLVM_CLANG_LIB_CODEGEN_SANITIZER_HANDLER_H
#define LIST_SANITIZER_CHECKS
\
- SANITIZER_CHECK(AddOverflow, add_overflow, 0)
\
- SANITIZER_CHECK(BuiltinUnreachable, bu
https://github.com/shafik commented:
Thank you for the fix, please add more details in the summary next time.
Something along the lines of "added diagnostic which now triggers when
which avoids the crash "
https://github.com/llvm/llvm-project/pull/149982
___
https://github.com/shafik commented:
Thank you for the fix, please add a release note.
https://github.com/llvm/llvm-project/pull/150025
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
No release note b/c you will backport?
https://github.com/llvm/llvm-project/pull/150186
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
Next time can you add more details to the summary, these are especially helpful
for downstream folks but also for reviewers. Something along the lines of
"Perform a null check in SanitizerAnnotateDebugInfo for the result of
getCurrentDebugLocation".
https:
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/150088
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -14631,8 +14631,9 @@ EvaluateComparisonBinaryOperator(EvalInfo &Info, const
BinaryOperator *E,
// - Otherwise pointer comparisons are unspecified.
if (!LHSDesignator.Invalid && !RHSDesignator.Invalid && IsRelational) {
bool WasArrayIndex;
- unsigned Misma
https://github.com/shafik approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/150088
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1445,3 +1445,8 @@ static_assert(test_member_null(), "");
}
}
+
+namespace GH149500 {
+ unsigned int * p = &(*(unsigned int *)0x400);
+ static const void *q = &(*(const struct sysrq_key_op *)0);
shafik wrote:
Maybe also `nullptr` test?
https://github.co
@@ -153,3 +150,7 @@ struct PR35214_X {
int PR35214_x;
int PR35214_y = ((struct PR35214_X *)&PR35214_x)->arr[1]; // expected-error
{{not a compile-time constant}}
int *PR35214_z = &((struct PR35214_X *)&PR35214_x)->arr[1]; // ok, &PR35214_x
+ 2
+
+
+int * GH149500_p = &(*(int
@@ -8392,17 +8392,19 @@ def ext_default_init_const : ExtWarn<
"is a Microsoft extension">,
InGroup;
def err_delete_operand : Error<"cannot delete expression of type %0">;
+def err_delete_void_ptr_operand : Error<
+ "cannot delete pointer to %0">;
def ext_delete_void_ptr_o
@@ -8392,17 +8392,19 @@ def ext_default_init_const : ExtWarn<
"is a Microsoft extension">,
InGroup;
def err_delete_operand : Error<"cannot delete expression of type %0">;
+def err_delete_void_ptr_operand : Error<
+ "cannot delete pointer to %0">;
def ext_delete_void_ptr_o
@@ -709,7 +709,8 @@ AST_MATCHER(FieldDecl, isBitField) {
/// fieldDecl(hasBitWidth(2))
/// matches 'int a;' and 'int c;' but not 'int b;'.
AST_MATCHER_P(FieldDecl, hasBitWidth, unsigned, Width) {
- return Node.isBitField() && Node.getBitWidthValue() == Width;
+ return Node.
@@ -10912,9 +10966,18 @@ bool
RecordExprEvaluator::VisitCXXParenListOrInitListExpr(
isa(Init));
APValue &FieldVal = Result.getStructField(Field->getFieldIndex());
-if (!EvaluateInPlace(FieldVal, Info, Subobject, Init) ||
-(Fie
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/143667
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5242,7 +5281,10 @@ static bool EvaluateVarDecl(EvalInfo &Info, const
VarDecl *VD) {
if (InitE->isValueDependent())
return false;
- if (!EvaluateInPlace(Val, Info, Result, InitE)) {
+ if (VD->getType()->isReferenceType() &&
shafik wrote:
Can we a
@@ -9293,7 +9344,10 @@ bool LValueExprEvaluator::VisitArraySubscriptExpr(const
ArraySubscriptExpr *E) {
}
bool LValueExprEvaluator::VisitUnaryDeref(const UnaryOperator *E) {
- return evaluatePointer(E->getSubExpr(), Result);
+ bool Success = evaluatePointer(E->getSubExpr(),
https://github.com/shafik commented:
Mostly looks good but I think we need more testing and some additional comments.
https://github.com/llvm/llvm-project/pull/143667
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bi
https://github.com/shafik commented:
I think this should have had a release note
https://github.com/llvm/llvm-project/pull/147938
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
This should have a release note.
https://github.com/llvm/llvm-project/pull/146729
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
shafik wrote:
> Fixes #91451
This should also be included in the summary of the PR.
https://github.com/llvm/llvm-project/pull/146729
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/138845
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1038,6 +1055,188 @@ Expected
ASTNodeImporter::import(ConceptReference *From) {
return ConceptRef;
}
+StringRef ASTNodeImporter::ImportASTStringRef(StringRef FromStr) {
+ char *ToStore = new (Importer.getToContext()) char[FromStr.size()];
+ std::copy(FromStr.begin(), F
https://github.com/shafik commented:
Do we have tests that cover these additions already?
https://github.com/llvm/llvm-project/pull/138845
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi
shafik wrote:
It looks like this commit is responsible for
https://github.com/llvm/llvm-project/issues/148325
https://github.com/llvm/llvm-project/pull/78088
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
@@ -2252,7 +2252,7 @@ void Parser::ParseBaseClause(Decl *ClassDecl) {
while (true) {
// Parse a base-specifier.
BaseResult Result = ParseBaseSpecifier(ClassDecl);
-if (Result.isInvalid()) {
+if (!Result.isUsable()) {
shafik wrote:
I am a bit
https://github.com/shafik commented:
Seems like this should have a release note?
https://github.com/llvm/llvm-project/pull/146976
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
Thanks, this is a nice refactor.
https://github.com/llvm/llvm-project/pull/147231
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
I guess we missed a release note?
https://github.com/llvm/llvm-project/pull/147514
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
shafik wrote:
> Why doesn't C++20 below suffer from the issue?
>
> I think it's a waste to add a Sema scope object just for diagnostic issues.
> It's more like that there's an underlying issue that would be otherwise
> hidden by the patch. Can you explore?
Thank you for this PR but I agree th
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/146960
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik created
https://github.com/llvm/llvm-project/pull/146960
Static analysis flagged this code as using copies when we could use move
instead. I used a temporary in some cases instead of an explicit move.
>From 672514ff2ab201ea9d3098f4a94251155533ce55 Mon Sep 17 00:00:00
https://github.com/shafik approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/146604
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
I am a little suspicious of this change because right now we are only calling
`ActOnCXXExitDeclInitializer` in `~InitializerScopeRAII()` and now it seems
like we need to sprinkle it in other places.
https://github.com/llvm/llvm-project/pull/144970
_
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/146127
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik created
https://github.com/llvm/llvm-project/pull/146127
Static analysis flagged some cases we could avoid copies by using std::move in
Disasm.cpp.
>From 6dbfe12457e7fd7dbb62d4cb5d53b3206b78e492 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour
Date: Fri, 27 Jun 2025 10
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/145988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
shafik wrote:
Looks like the window CI fail is related to this issue:
https://github.com/llvm/llvm-project/issues/145703
https://github.com/llvm/llvm-project/pull/145988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cg
@@ -16,27 +16,22 @@ APValue FunctionPointer::toAPValue(const ASTContext &)
const {
return APValue(static_cast(nullptr), CharUnits::Zero(), {},
/*OnePastTheEnd=*/false, /*IsNull=*/true);
- if (!Valid)
-return APValue(static_cast(nullptr),
-
https://github.com/shafik commented:
Thank you for looking into this one.
https://github.com/llvm/llvm-project/pull/145679
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
As a previous comment noted, this needs a release note but I think the summary
should also mention that this fixes the warning diagnostic from
`-Wdangling-gsl`. Maybe worth a comment in the test explaining these are
verifying we don't trigger a diagnostic f
@@ -139,10 +139,9 @@ class TokenLexer {
void Init(const Token *TokArray, unsigned NumToks, bool
DisableMacroExpansion,
bool OwnsTokens, bool IsReinject);
- /// If the next token lexed will pop this macro off the
- /// expansion stack, return 2. If the next un
@@ -539,19 +537,29 @@ static void initializeBuffer(CodeGenModule &CGM,
llvm::GlobalVariable *GV,
}
static void initializeBufferFromBinding(CodeGenModule &CGM,
-llvm::GlobalVariable *GV, unsigned
Slot,
-
https://github.com/shafik commented:
LGTM
https://github.com/llvm/llvm-project/pull/142713
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -43,6 +43,11 @@ void call_snprintf(double d, int n, int *ptr) {
__builtin_snprintf(node_name, sizeof(node_name), "%pOFn", ptr); //
nonkprintf-warning {{'snprintf' will always be truncated; specified size is 6,
but format string expands to at least 7}}
__builtin_snprintf
@@ -5223,6 +5230,24 @@ enum EvalStmtResult {
};
}
+static bool EvaluateInitForDeclOfReferenceType(EvalInfo &Info,
+ const ValueDecl *D,
+ const Expr *Init, LValue
&Result,
+
@@ -4426,7 +4431,7 @@ static CompleteObject findCompleteObject(EvalInfo &Info,
const Expr *E,
// Unless we're looking at a local variable or argument in a constexpr
call,
// the variable we're reading must be const.
-if (!Frame) {
+if (AK != clang::AK_Referen
@@ -1547,6 +1547,58 @@ ExprResult Sema::ActOnTypeTrait(TypeTrait Kind,
SourceLocation KWLoc,
return BuildTypeTrait(Kind, KWLoc, ConvertedArgs, RParenLoc);
}
+bool Sema::BuiltinIsBaseOf(SourceLocation RhsTLoc, QualType LhsT,
+ QualType RhsT) {
+ //
@@ -1547,6 +1547,58 @@ ExprResult Sema::ActOnTypeTrait(TypeTrait Kind,
SourceLocation KWLoc,
return BuildTypeTrait(Kind, KWLoc, ConvertedArgs, RParenLoc);
}
+bool Sema::BuiltinIsBaseOf(SourceLocation RhsTLoc, QualType LhsT,
+ QualType RhsT) {
+ //
@@ -7219,6 +7219,17 @@ Sema::ActOnCompoundLiteral(SourceLocation LParenLoc,
ParsedType Ty,
return BuildCompoundLiteralExpr(LParenLoc, TInfo, RParenLoc, InitExpr);
}
+static bool IsInsideFunction(Scope *S) {
shafik wrote:
@AaronBallman it feels like it make
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/143830
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -13632,82 +13632,36 @@ bool Sema::CheckUsingDeclQualifier(SourceLocation
UsingLoc, bool HasTypename,
RequireCompleteDeclContext(const_cast(SS), NamedContext))
return true;
- if (getLangOpts().CPlusPlus11) {
-// C++11 [namespace.udecl]p3:
-// In a using
https://github.com/shafik commented:
@Endilll has been handling a lot of conformance testing, so please wait for
more feedback from him before landing.
https://github.com/llvm/llvm-project/pull/143492
___
cfe-commits mailing list
cfe-commits@lists.llv
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/143492
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/143827
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
I would also like to see some more background info on how we came up with the
original limit (if it exists).
https://github.com/llvm/llvm-project/pull/143785
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/shafik created
https://github.com/llvm/llvm-project/pull/143830
Static analysis flagged Input as a large object that would benefit from being
moved over being copied.
>From ea85dd226ad4c8a6f9ef0a7f16c22fdc386c1334 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour
Date: Wed, 11
https://github.com/shafik created
https://github.com/llvm/llvm-project/pull/143827
Static analysis flagged FatbinFileName since we can move it instead of copying
it.
>From 5fd6d2ff512a971b8e6ad8f900c31a1b74b49ed5 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour
Date: Wed, 11 Jun 2025 20:58:07 -
https://github.com/shafik commented:
I have the same questions as @efriedma-quic
https://github.com/llvm/llvm-project/pull/143667
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1321,3 +1321,24 @@ constexpr bool check = different_in_loop();
// expected-error@-1 {{}} expected-note@-1 {{in call}}
}
+
+namespace GH48665 {
+constexpr bool foo(int *i) {
shafik wrote:
Other tests: https://godbolt.org/z/o66Gr3fc8
```cpp
struct A {
@@ -35,6 +35,7 @@ enum AccessKinds {
AK_Construct,
AK_Destroy,
AK_IsWithinLifetime,
+ AK_CheckReferenceInitialization
shafik wrote:
```suggestion
AK_ReferenceInitialization
```
I could also go for `AK_ReadForReferenceInitialization`. The "Check" is w
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/143667
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/143611
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3673,6 +3678,8 @@ void Parser::ParseDeclarationSpecifiers(
*Next.getIdentifierInfo(), Next.getLocation(), getCurScope(), &SS,
false, false, nullptr,
shafik wrote:
Also applies in some other places as well.
https://github.com/llvm/llvm-p
@@ -3673,6 +3678,8 @@ void Parser::ParseDeclarationSpecifiers(
*Next.getIdentifierInfo(), Next.getLocation(), getCurScope(), &SS,
false, false, nullptr,
shafik wrote:
Please add bugprone-argument-comments for these as well, since you are
mo
https://github.com/shafik commented:
It feels like having `isDefaultedOnDeclaration()` would be tremendously more
readable and express the intent rather than doing "the dance" when necessary.
https://github.com/llvm/llvm-project/pull/143661
___
cfe-c
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/143578
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/143646
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik updated
https://github.com/llvm/llvm-project/pull/143578
>From 09060e9a91842346f106d55b32141b16efe7378d Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour
Date: Tue, 10 Jun 2025 10:41:04 -0700
Subject: [PATCH 1/3] [Clang][ByteCode][NFC] Move APInt into pushInteger since
i
https://github.com/shafik updated
https://github.com/llvm/llvm-project/pull/143603
>From 6bcbd5e1691edd4cbc36bd0c318cdd3b526db1c3 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour
Date: Tue, 10 Jun 2025 13:51:19 -0700
Subject: [PATCH 1/2] [Clang][Tooling][NFC] Use move to avoid copies of large
ob
@@ -4920,6 +4914,11 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind
DKind,
ModifierFound = true;
} else {
StepFound = parseStepSize(*this, Data, Kind, Tok.getLocation());
+if (!StepFound) {
shafik wrote:
hu
https://github.com/shafik created
https://github.com/llvm/llvm-project/pull/143611
Static analysis flagged that we could move HeadingAndSpellings and avoid a copy
of a large object.
>From 55d520891a09e3cd3ef85eeba501ad80d8240619 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour
Date: Tue, 10 Jun
https://github.com/shafik created
https://github.com/llvm/llvm-project/pull/143603
Static analysis flagged these cases in which can use std::move and avoid copies
of large objects.
>From 6bcbd5e1691edd4cbc36bd0c318cdd3b526db1c3 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour
Date: Tue, 10 Jun
https://github.com/shafik updated
https://github.com/llvm/llvm-project/pull/143578
>From 09060e9a91842346f106d55b32141b16efe7378d Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour
Date: Tue, 10 Jun 2025 10:41:04 -0700
Subject: [PATCH 1/2] [Clang][ByteCode][NFC] Move APInt into pushInteger since
i
https://github.com/shafik created
https://github.com/llvm/llvm-project/pull/143578
Static analysis flagged that we could move APInt instead of copy, indeed it has
a move constructor and so we should move into values for APInt.
>From 09060e9a91842346f106d55b32141b16efe7378d Mon Sep 17 00:00:00
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/143443
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik approved this pull request.
Thank you for the fix!
https://github.com/llvm/llvm-project/pull/143448
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
You should always have a summary, for this one it could have simply been
"replace std::count with llvm::count in Sema::CheckBaseSpecifier"
https://github.com/llvm/llvm-project/pull/143228
___
cfe-commits mailing li
@@ -1763,27 +1763,39 @@ def err_user_defined_msg_constexpr : Error<
"constant expression">;
// Type traits explanations
-def note_unsatisfied_trait : Note<"%0 is not %enum_select{"
- "%TriviallyRelocatable{trivially
relocatable}|"
-
@@ -14055,8 +14055,10 @@ FunctionDecl
*Sema::ResolveSingleFunctionTemplateSpecialization(
// specified and it, along with any default template arguments,
// identifies a single function template specialization, then the
// template-id is an lvalue for the fun
@@ -4920,6 +4914,11 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind
DKind,
ModifierFound = true;
} else {
StepFound = parseStepSize(*this, Data, Kind, Tok.getLocation());
+if (!StepFound) {
shafik wrote:
I
@@ -2513,6 +2513,9 @@ void testValueInRangeOfEnumerationValues() {
// expected-error@-1 {{constexpr variable 'x2' must be initialized by a
constant expression}}
// expected-note@-2 {{integer value 8 is outside the valid range of values
[-8, 7] for the enumeration type 'E1'
https://github.com/shafik created
https://github.com/llvm/llvm-project/pull/143443
Static analysis flagged HasBody as not being initialized during construction.
It looks like an oversight in: https://github.com/llvm/llvm-project/pull/139671
This would be a lot simpler with C++20 which allows i
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/143067
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -539,19 +537,29 @@ static void initializeBuffer(CodeGenModule &CGM,
llvm::GlobalVariable *GV,
}
static void initializeBufferFromBinding(CodeGenModule &CGM,
-llvm::GlobalVariable *GV, unsigned
Slot,
-
@@ -4431,7 +4431,11 @@ destroy the object before returning. The lifetime of the
copy of the parameter
in the caller ends without a destructor call when the call begins.
If a type is trivial for the purpose of calls, it is assumed to be trivially
-relocatable for the purpose o
@@ -143,3 +143,8 @@ namespace fold_initializer {
const float A::f = __builtin_is_constant_evaluated();
static_assert(fold(A::f == 1.0f));
}
+
+struct GH99680 {
+ static const int x = 1/(1-__builtin_is_constant_evaluated()); //
expected-error {{in-class initializer for sta
@@ -3167,3 +3167,29 @@ void tools::handleInterchangeLoopsArgs(const ArgList
&Args,
options::OPT_fno_loop_interchange, EnableInterchange))
CmdArgs.push_back("-floop-interchange");
}
+
+std::optional tools::ParseMPreferVectorWidthOption(
+clang::Diagno
shafik wrote:
> If this were a bug, I suspect it would have been reported. Most likely,
> `dyn_cast_or_null(Entity.getDecl());` is never null, and could be
> replaced by `cast`? Did you try that?
It could but that feel like a weak argument, I would like something stronger.
We do `dyn_cast_or_
@@ -16597,7 +16597,8 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation
CaretLoc,
BD->setCaptures(Context, Captures, BSI->CXXThisCaptureIndex != 0);
// Pop the block scope now but keep it alive to the end of this function.
- AnalysisBasedWarnings::Policy WP = Analysis
@@ -16597,7 +16597,8 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation
CaretLoc,
BD->setCaptures(Context, Captures, BSI->CXXThisCaptureIndex != 0);
// Pop the block scope now but keep it alive to the end of this function.
- AnalysisBasedWarnings::Policy WP = Analysis
@@ -3167,3 +3167,29 @@ void tools::handleInterchangeLoopsArgs(const ArgList
&Args,
options::OPT_fno_loop_interchange, EnableInterchange))
CmdArgs.push_back("-floop-interchange");
}
+
+std::optional tools::ParseMPreferVectorWidthOption(
+clang::Diagno
@@ -3167,3 +3167,29 @@ void tools::handleInterchangeLoopsArgs(const ArgList
&Args,
options::OPT_fno_loop_interchange, EnableInterchange))
CmdArgs.push_back("-floop-interchange");
}
+
+std::optional tools::ParseMPreferVectorWidthOption(
+clang::Diagno
@@ -143,3 +143,8 @@ namespace fold_initializer {
const float A::f = __builtin_is_constant_evaluated();
static_assert(fold(A::f == 1.0f));
}
+
+struct GH99680 {
+ static const int x = 1/(1-__builtin_is_constant_evaluated()); //
expected-error {{in-class initializer for sta
https://github.com/shafik commented:
I think some of these examples are covered in the test suite but I am not sure
if all are. Can you confirm this is consistent with:
https://eel.is/c++draft/expr.const#28.5
https://github.com/llvm/llvm-project/pull/142713
https://github.com/shafik commented:
So just to confirm my reading, this is benefiting from
`CheckCompleteVariableDeclaration` doing:
```cpp
// Evaluate the initializer to see if it's a constant initializer.
HasConstInit = var->checkForConstantInitialization(Notes);
```
or is there more?
https://github.com/shafik created
https://github.com/llvm/llvm-project/pull/142851
Static analysis flagged this since we could move MergedRanges since it is a
std::vector, a local and unused after that line. So there is a potential saving.
>From b427ae1ef18c48126a0faf5f40678cc6e4e30634 Mon Sep
@@ -1343,12 +1343,21 @@ static bool EvaluateBooleanTypeTrait(Sema &S, TypeTrait
Kind,
if (RD && RD->isAbstract())
return false;
+// LWG3819: For reference_meows_from_temporary traits, && is not added to
shafik wrote:
After some offline discussi
@@ -160,7 +160,7 @@ template struct X;
// Make sure that the instantiated constructor initializes start and
// end properly.
-// CHECK-LABEL: define linkonce_odr void @_ZN1XIiEC2ERKS0_(ptr {{[^,]*}}
%this, ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %othe
1 - 100 of 1163 matches
Mail list logo