[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2024-01-17 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/72428 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2024-01-16 Thread Aaron Ballman via cfe-commits
@@ -13570,6 +13570,15 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { CreateRecoveryExpr(Init->getBeginLoc(), Init->getEndLoc(), Args); if (RecoveryExpr.get()) VDecl->setInit(RecoveryExpr.get()); + // In general,

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

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

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2024-01-16 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM with a tiny nit. https://github.com/llvm/llvm-project/pull/72428 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2024-01-08 Thread Haojian Wu via cfe-commits
hokein wrote: Friendly ping. https://github.com/llvm/llvm-project/pull/72428 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2024-01-08 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/72428 >From 662be3d00eed883db6b1babe489b981847e9b907 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 15 Nov 2023 20:31:12 +0100 Subject: [PATCH 1/3] [clang][AST] Invalidate DecompositionDecl if it has invalid

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-12-19 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/72428 >From f114c48948d8b56a5e04e50b7f27ce499e60bc77 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 15 Nov 2023 20:31:12 +0100 Subject: [PATCH 1/3] [clang][AST] Invalidate DecompositionDecl if it has invalid

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-12-19 Thread Haojian Wu via cfe-commits
hokein wrote: > We need a release note and please add a more detailed summary. A description > of the problem being solved and the solution to the fix provides. Done. https://github.com/llvm/llvm-project/pull/72428 ___ cfe-commits mailing list

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-12-19 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/72428 >From e182e764778eb137f465812270fcdf03d0fe2da1 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 15 Nov 2023 20:31:12 +0100 Subject: [PATCH 1/3] [clang][AST] Invalidate DecompositionDecl if it has invalid

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-12-19 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/72428 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-12-18 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: We need a release note and please add a more detailed summary. A description of the problem being solved and the solution to the fix provides. https://github.com/llvm/llvm-project/pull/72428 ___ cfe-commits

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-12-18 Thread Haojian Wu via cfe-commits
hokein wrote: Friendly ping. https://github.com/llvm/llvm-project/pull/72428 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-17 Thread Henrik G. Olsson via cfe-commits
hnrklssn wrote: > > What differentiates the DecompositionDecl such that we need to mark the > > decl invalid when there's an error in the RHS, while for other decls we > > don't? It seems inconsistent. > > > > DecompositionDecl (aka structure binding) is special here, a legal >

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-17 Thread Haojian Wu via cfe-commits
hokein wrote: > What differentiates the DecompositionDecl such that we need to mark the decl > invalid when there's an error in the RHS, while for other decls we don't? It > seems inconsistent. DecompositionDecl (aka structure binding) is special here, a legal DecompositionDecl must be

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-17 Thread Haojian Wu via cfe-commits
@@ -13540,6 +13540,15 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { CreateRecoveryExpr(Init->getBeginLoc(), Init->getEndLoc(), Args); if (RecoveryExpr.get()) VDecl->setInit(RecoveryExpr.get()); + // In general,

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-17 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/72428 >From ac06843b97cb93d476f0bf8e0474fa270d80631f Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 15 Nov 2023 20:31:12 +0100 Subject: [PATCH 1/2] [clang][AST] Invalidate DecompositionDecl if it has invalid

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-16 Thread Shafik Yaghmour via cfe-commits
@@ -13540,6 +13540,15 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { CreateRecoveryExpr(Init->getBeginLoc(), Init->getEndLoc(), Args); if (RecoveryExpr.get()) VDecl->setInit(RecoveryExpr.get()); + // In general,

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-16 Thread via cfe-commits
@@ -24,4 +24,17 @@ void test() { auto b4 = A(1); // CHECK: `-VarDecl {{.*}} invalid b5 'auto' auto b5 = A{1}; -} \ No newline at end of file +} + +void pr72198() { + // CHECK: DecompositionDecl {{.*}} invalid 'int' + int [_, b] = {0, 0}; + [b]{}; +} + +int

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-16 Thread via cfe-commits
@@ -24,4 +24,17 @@ void test() { auto b4 = A(1); // CHECK: `-VarDecl {{.*}} invalid b5 'auto' auto b5 = A{1}; -} \ No newline at end of file +} + +void pr72198() { cor3ntin wrote: ```suggestion void GH72198() { ```

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-16 Thread via cfe-commits
@@ -13540,6 +13540,15 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { CreateRecoveryExpr(Init->getBeginLoc(), Init->getEndLoc(), Args); if (RecoveryExpr.get()) VDecl->setInit(RecoveryExpr.get()); + // In general,

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-16 Thread Henrik G. Olsson via cfe-commits
hnrklssn wrote: What differentiates the DecompositionDecl such that we need to mark the decl invalid when there's an error in the RHS, while for other decls we don't? It seems inconsistent. https://github.com/llvm/llvm-project/pull/72428 ___

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Haojian Wu (hokein) Changes Fix #67495, #72198 CC @ADKaster, @ecnelises --- Full diff: https://github.com/llvm/llvm-project/pull/72428.diff 2 Files Affected: - (modified) clang/lib/Sema/SemaDecl.cpp (+9) - (modified)

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-15 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/72428 Fix #67495, #72198 CC @ADKaster, @ecnelises >From 13b97a2239c93fe528174ec9ecc20f3d3ca49e23 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 15 Nov 2023 20:31:12 +0100 Subject: [PATCH] [clang][AST]