[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

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

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-14 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 approved this pull request. https://github.com/llvm/llvm-project/pull/111753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-14 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/111753 >From 354b33432d0dafbf54667a9ee973f5b2712c5773 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 9 Oct 2024 21:34:49 +0200 Subject: [PATCH 1/2] [clang] Diagnose the dangling references for vector. --- clang/

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-14 Thread Haojian Wu via cfe-commits
@@ -404,7 +404,7 @@ shouldTrackFirstArgumentForConstructor(const CXXConstructExpr *Ctor) { if (LHSRecordDecl->hasAttr()) return true; - if (Ctor->getConstructor()->getNumParams() != 1 || + if (Ctor->getConstructor()->getNumParams() < 1 || hokein wrote

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-09 Thread Utkarsh Saxena via cfe-commits
@@ -404,7 +404,7 @@ shouldTrackFirstArgumentForConstructor(const CXXConstructExpr *Ctor) { if (LHSRecordDecl->hasAttr()) return true; - if (Ctor->getConstructor()->getNumParams() != 1 || + if (Ctor->getConstructor()->getNumParams() < 1 || usx95 wrote:

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-09 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/111753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-09 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 approved this pull request. LGTM. Thanks for the quick fix. https://github.com/llvm/llvm-project/pull/111753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Haojian Wu (hokein) Changes This is a follow-up to https://github.com/llvm/llvm-project/pull/108344. The original bailout check was overly strict, causing it to miss cases like the vector(initializer_list, allocator) constructor. This pat

[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

2024-10-09 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/111753 This is a follow-up to https://github.com/llvm/llvm-project/pull/108344. The original bailout check was overly strict, causing it to miss cases like the vector(initializer_list, allocator) constructor. This patc