https://github.com/shafik commented:
This needs a release note and it would be helpful to know how you found this
and a test w/ a minimal reproducer. Are there any bugs reports for this?
https://github.com/llvm/llvm-project/pull/130712
___
cfe-commits
@@ -10921,8 +10921,8 @@ void Sema::CheckConstructor(CXXConstructorDecl
*Constructor) {
// parameters have default arguments.
if (!Constructor->isInvalidDecl() &&
Constructor->hasOneParamOrDefaultArgs() &&
- Constructor->getTemplateSpecializationKind() !=
-
@@ -0,0 +1,117 @@
+// RUN: %clang_cc1 -verify=expected,c2y -pedantic -std=c2y %s
+// RUN: %clang_cc1 -verify=expected,c2y,compat -Wpre-c2y-compat -std=c2y %s
+// RUN: %clang_cc1 -verify=expected,ext -pedantic -std=c23 %s
+// RUN: %clang_cc1 -verify=expected,cpp -pedantic -x c++ -W
shafik wrote:
It looks like this is linked to:
https://github.com/llvm/llvm-project/issues/131410
and it is not clear to me the diagnostic in these cases makes a lot of sense or
at least the motivation does not feel strong to me.
This new approach feels evolutionary to me and if this was the
@@ -0,0 +1,117 @@
+// RUN: %clang_cc1 -verify=expected,c2y -pedantic -std=c2y %s
+// RUN: %clang_cc1 -verify=expected,c2y,compat -Wpre-c2y-compat -std=c2y %s
+// RUN: %clang_cc1 -verify=expected,ext -pedantic -std=c23 %s
+// RUN: %clang_cc1 -verify=expected,cpp -pedantic -x c++ -W
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/131626
___
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/131515
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,182 @@
+// RUN: %clang_cc1 %s -std=c++2c -fsyntax-only -verify
+// RUN: %clang_cc1 %s -std=c++2c -fsyntax-only -verify
-fexperimental-new-constant-interpreter
+
+
+struct S0 {};
+struct S1 {int a;};
+struct S2 {int a; int b;};
+struct S3 {double a; int b; int c;};
@@ -257,7 +260,7 @@ Improvements to Clang's diagnostics
as function arguments or return value respectively. Note that
:doc:`ThreadSafetyAnalysis` still does not perform alias analysis. The
feature will be default-enabled with ``-Wthread-safety`` in a future release.
-- Th
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/131515
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -368,7 +368,11 @@ std::optional SValBuilder::getConstantVal(const Expr
*E) {
case Stmt::TypeTraitExprClass: {
const auto *TE = cast(E);
-return makeTruthVal(TE->getValue(), TE->getType());
+if (TE->isStoredAsBoolean())
+ return makeTruthVal(TE->getBoolVa
@@ -1911,6 +1911,38 @@ A simplistic usage example as might be seen in standard
C++ headers follows:
// Emulate type trait for compatibility with other compilers.
#endif
+
+.. _builtin_structured_binding_size-doc:
+
+__builtin_structured_binding_size (C++)
+---
@@ -10792,47 +10822,54 @@ void ASTReader::FinishedDeserializing() {
--NumCurrentElementsDeserializing;
if (NumCurrentElementsDeserializing == 0) {
-// Propagate exception specification and deduced type updates along
-// redeclaration chains.
-//
-// We do t
@@ -4309,12 +4309,12 @@ Decl *ASTReader::ReadDeclRecord(GlobalDeclID ID) {
void ASTReader::PassInterestingDeclsToConsumer() {
assert(Consumer);
- if (PassingDeclsToConsumer)
+ if (!CanPassDeclsToConsumer)
return;
// Guard variable to avoid recursively redoing the
https://github.com/shafik approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/131450
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
Thank you for the quick fix, I would have also added the test that did not
crash but issued a diagnostic from the issue as well:
https://github.com/llvm/llvm-project/issues/131530
unless we have a similar test already.
https://github.com/llvm/llvm-project/
https://github.com/shafik commented:
I think you need to update this too, unless I missed something:
https://clang.llvm.org/docs/UsersManual.html#controlling-implementation-limits
https://github.com/llvm/llvm-project/pull/132021
___
cfe-commits mailin
https://github.com/shafik commented:
Why was this landed w/o any approvals?
https://github.com/llvm/llvm-project/pull/132516
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
Thank you for the fix!
Second, that we need a summary explaining the problem and solution.
Is this linked to a bug report, if it is, then we should mention that bug
report as well.
I would also like to see a test showing a case where we successfully print
shafik wrote:
> Clang does crash with one of the included test cases, if you try to actually
> use the function: https://godbolt.org/z/e6e6Ehjoj
That is not a regression test, at minimum when fixing a bug we should include a
test that directly reproduces the bug to ensure that we don't reintro
https://github.com/shafik commented:
LGTM, thank you for adding this comment!
https://github.com/llvm/llvm-project/pull/132527
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1886,8 +1891,9 @@ TEST_F(StructuralEquivalenceCacheTest,
VarDeclWithDifferentStorageClassNoEq) {
Lang_CXX03);
StructuralEquivalenceContext Ctx(
- get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(),
- NonEquivalentDecls, StructuralEquivalenceKind::D
https://github.com/shafik commented:
This should have had a release note.
https://github.com/llvm/llvm-project/pull/134361
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
shafik wrote:
> Why was this landed w/o any approvals?
I am reading the PR and I see now this was a fix for something you just landed
but that was not clear from the summary in the PR.
https://github.com/llvm/llvm-project/pull/132516
___
cfe-commits
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/131677
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
CC @mizvekov since it was suggested this is related to
https://github.com/llvm/llvm-project/issues/126550 and it looked like based on
the conversation there, there was some existing work going on.
https://github.com/llvm/llvm-project/pull/132919
___
@@ -3629,17 +3644,17 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const
Expr *E,
Result = VD->getEvaluatedValue();
- // C++23 [expr.const]p8
- // ... For such an object that is not usable in constant expressions, the
- // dynamic type of the object is constexpr-un
https://github.com/shafik commented:
@BruceAko why did you close the PR?
https://github.com/llvm/llvm-project/pull/132320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
shafik wrote:
Looks like this is linked to the following regression:
https://github.com/llvm/llvm-project/issues/133688
https://github.com/llvm/llvm-project/pull/75456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-
@@ -156,11 +158,11 @@ struct StructuralEquivalenceTest : ::testing::Test {
StructuralEquivalenceContext::NonEquivalentDeclSet NonEquivalentDecls01;
StructuralEquivalenceContext::NonEquivalentDeclSet NonEquivalentDecls10;
StructuralEquivalenceContext Ctx01(
-
@@ -2080,9 +2090,9 @@ TEST_F(StructuralEquivalenceCacheTest, TemplateParmDepth)
{
EXPECT_FALSE(isInNonEqCache(std::make_pair(NonEqDecl0, NonEqDecl1), true));
StructuralEquivalenceContext Ctx_IgnoreTemplateParmDepth(
- get<0>(TU)->getASTContext(), get<1>(TU)->getASTCo
@@ -11432,6 +11433,22 @@ static QualType mergeEnumWithInteger(ASTContext
&Context, const EnumType *ET,
return {};
}
+QualType ASTContext::mergeTagTypes(QualType LHS, QualType RHS) {
+ // C17 and earlier and C++ disallow two tag definitions within the same TU
+ // from bei
@@ -2003,8 +2012,9 @@ TEST_F(StructuralEquivalenceCacheTest, Cycle) {
Lang_CXX03);
StructuralEquivalenceContext Ctx(
- get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(),
- NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false);
+ ge
@@ -9089,8 +9089,8 @@ bool Sema::hasStructuralCompatLayout(Decl *D, Decl
*Suggested) {
// FIXME: Add a specific mode for C11 6.2.7/1 in StructuralEquivalenceContext
// and isolate from other C++ specific checks.
StructuralEquivalenceContext Ctx(
- D->getASTContext()
@@ -1932,8 +1939,9 @@ TEST_F(StructuralEquivalenceCacheTest,
VarDeclWithInitNoEq) {
Lang_CXX03);
StructuralEquivalenceContext Ctx(
- get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(),
- NonEquivalentDecls, StructuralEquivalenceKind::Default, false, fa
@@ -1868,8 +1872,9 @@ TEST_F(StructuralEquivalenceCacheTest, VarDeclNoEq) {
Lang_CXX03);
StructuralEquivalenceContext Ctx(
- get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(),
- NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false);
+
@@ -1826,8 +1828,9 @@ TEST_F(StructuralEquivalenceCacheTest, SimpleNonEq) {
Lang_CXX03);
StructuralEquivalenceContext Ctx(
- get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(),
- NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false);
+
@@ -1572,13 +1571,12 @@ TryCastResult TryLValueToRValueCast(Sema &Self, Expr
*SrcExpr,
if (RefConv & Sema::ReferenceConversions::DerivedToBase) {
Kind = CK_DerivedToBase;
-CXXBasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/true,
- /*D
@@ -23,3 +22,66 @@ void test(A &a, B &b) {
const A &&ar10 = static_cast(xvalue());
const A &&ar11 = static_cast(xvalue());
}
+
+struct C : private A { // expected-note 4 {{declared private here}}
shafik wrote:
Normally when we add tests to an existing file
@@ -1964,8 +1972,9 @@ TEST_F(StructuralEquivalenceCacheTest, SpecialNonEq) {
Lang_CXX03);
StructuralEquivalenceContext Ctx(
- get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(),
- NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false);
+
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/132939
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4567,8 +4567,9 @@ namespace {
Reader.getOwningModuleFile(Cat)) {
StructuralEquivalenceContext::NonEquivalentDeclSet
NonEquivalentDecls;
StructuralEquivalenceContext Ctx(
- Cat->getASTContext(), Existing->getASTCo
https://github.com/shafik commented:
A lot of nits
https://github.com/llvm/llvm-project/pull/132939
___
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 have a few concerns w/ this PR.
Number one we do not cover the original test case which crashes, as far as I
can tell none of the tests crash before this fix. This is large oversight.
It looks like currently gcc is the only one that rejects this code as w
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/132939
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
Second round of comments, I may make a third go around but I wouldn't wait for
me.
https://github.com/llvm/llvm-project/pull/132939
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
@@ -0,0 +1,472 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c23 -pedantic -Wall -Wno-comment
-verify=both,c23 %s
+// RUN: %clang_cc1 -fsyntax-only -std=c17 -pedantic -Wall -Wno-comment
-Wno-c23-extensions -verify=both,c17 %s
+
+/* WG14 N3037:
+ * Improved tag compatibility
+ *
+ *
@@ -0,0 +1,472 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c23 -pedantic -Wall -Wno-comment
-verify=both,c23 %s
+// RUN: %clang_cc1 -fsyntax-only -std=c17 -pedantic -Wall -Wno-comment
-Wno-c23-extensions -verify=both,c17 %s
+
+/* WG14 N3037:
+ * Improved tag compatibility
+ *
+ *
@@ -0,0 +1,472 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c23 -pedantic -Wall -Wno-comment
-verify=both,c23 %s
+// RUN: %clang_cc1 -fsyntax-only -std=c17 -pedantic -Wall -Wno-comment
-Wno-c23-extensions -verify=both,c17 %s
+
+/* WG14 N3037:
+ * Improved tag compatibility
+ *
+ *
@@ -0,0 +1,117 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment -verify
%s
+// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment
-fexperimental-new-constant-interpreter -verify %s
+
+/* WG14 N3369: Clang 21
+ * _Lengthof operator
+ *
+
@@ -0,0 +1,117 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment -verify
%s
+// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment
-fexperimental-new-constant-interpreter -verify %s
+
+/* WG14 N3369: Clang 21
+ * _Lengthof operator
+ *
+
@@ -467,3 +467,29 @@ namespace VexingParse {
template int var; // expected-note {{declared here}}
int x(var); // expected-error {{use of variable template 'var' requires
template arguments}}
}
+
+#ifndef PRECXX11
+
+namespace GH79750 {
shafik wrote:
I am
@@ -177,3 +177,50 @@ namespace extern_reference_used_as_unknown {
int y;
constinit int& g = (x,y); // expected-warning {{left operand of comma
operator has no effect}}
}
+
+namespace uninit_reference_used {
+ int y;
+ constexpr int &r = r; // expected-error {{must be ini
shafik wrote:
> LGTM with nit addressed. Test coverage would be nice to add, but not strictly
> required if this is purely a defensive measure (which it seems to be).
Exactly.
https://github.com/llvm/llvm-project/pull/131677
___
cfe-commits mailing l
@@ -1913,8 +1919,9 @@ TEST_F(StructuralEquivalenceCacheTest,
Lang_CXX03);
StructuralEquivalenceContext Ctx(
- get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(),
- NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false);
+ get<0>(TU)-
@@ -1849,8 +1852,9 @@ TEST_F(StructuralEquivalenceCacheTest, ReturnStmtNonEq) {
Lang_CXX03);
StructuralEquivalenceContext Ctx(
- get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(),
- NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false);
901 - 956 of 956 matches
Mail list logo