[clang] [compiler-rt] [Clang] Make `-Wreturn-type` default to an error in all language modes (PR #123470)

2025-02-18 Thread Jeremy Rifkin via cfe-commits
jeremy-rifkin wrote: Hi @foxtran, I have been working on a proposal on the C++ side. Extensive justification is needed to justify breakage here and I have been attempting to survey the extent of potential breakage. The wording is also tricky especially since attributes are designed to be ignor

[clang] [compiler-rt] [Clang] Make `-Wreturn-type` default to an error in all language modes (PR #123470)

2025-01-19 Thread Jeremy Rifkin via cfe-commits
jeremy-rifkin wrote: There are implications with #123166, which might also be clang 21 material https://github.com/llvm/llvm-project/pull/123470 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [Clang][Analysis] Don't treat the default switch path as unreachable when all enumerators are covered (PR #123166)

2025-01-18 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin updated https://github.com/llvm/llvm-project/pull/123166 >From e1ce92c0f54301cacaba316d38d44d20c6d61cb8 Mon Sep 17 00:00:00 2001 From: Jeremy Rifkin <51220084+jeremy-rif...@users.noreply.github.com> Date: Thu, 16 Jan 2025 00:27:03 -0600 Subject: [PATCH 1/4] Don't

[clang] [Clang][Analysis] Don't treat the default switch path as unreachable when all enumerators are covered (PR #123166)

2025-01-18 Thread Jeremy Rifkin via cfe-commits
@@ -170,16 +170,14 @@ void test_nested_switch() { } } -// Test that if all the values of an enum covered, that the 'default' branch -// is unreachable. +// Test that a warning is not emitted if the code is unreachable. enum Values { A, B, C, D }; void test_all_enums_covere

[clang] Don't treat the default switch path as unreachable when all enumerators are covered (PR #123166)

2025-01-16 Thread Jeremy Rifkin via cfe-commits
@@ -170,16 +170,14 @@ void test_nested_switch() { } } -// Test that if all the values of an enum covered, that the 'default' branch -// is unreachable. +// Test that a warning is not emitted if the code is unreachable. enum Values { A, B, C, D }; void test_all_enums_covere

[clang] [Clang][Analysis] Don't treat the default switch path as unreachable when all enumerators are covered (PR #123166)

2025-01-16 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin edited https://github.com/llvm/llvm-project/pull/123166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Don't treat the default switch path as unreachable when all enumerators are covered (PR #123166)

2025-01-16 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin updated https://github.com/llvm/llvm-project/pull/123166 >From e1ce92c0f54301cacaba316d38d44d20c6d61cb8 Mon Sep 17 00:00:00 2001 From: Jeremy Rifkin <51220084+jeremy-rif...@users.noreply.github.com> Date: Thu, 16 Jan 2025 00:27:03 -0600 Subject: [PATCH 1/3] Don't

[clang] Don't treat the default switch path as unreachable when all enumerators are covered (PR #123166)

2025-01-16 Thread Jeremy Rifkin via cfe-commits
jeremy-rifkin wrote: Hi Erich, thanks for taking a look. My preference here would be to explicitly mark the default path as unreachable as such if the intent of the code is that the code path should be unreachable, similar to how one might write: ```cpp bool is_prime(int num) { if(num < 0)

[clang] Don't treat the default switch path as unreachable when all enumerators are covered (PR #123166)

2025-01-15 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin edited https://github.com/llvm/llvm-project/pull/123166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Don't treat the default switch path as unreachable when all enumerators are covered (PR #123166)

2025-01-15 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin updated https://github.com/llvm/llvm-project/pull/123166 >From e1ce92c0f54301cacaba316d38d44d20c6d61cb8 Mon Sep 17 00:00:00 2001 From: Jeremy Rifkin <51220084+jeremy-rif...@users.noreply.github.com> Date: Thu, 16 Jan 2025 00:27:03 -0600 Subject: [PATCH 1/2] Don't

[clang] Don't treat the default switch path as unreachable when all enumerators are covered (PR #123166)

2025-01-15 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin created https://github.com/llvm/llvm-project/pull/123166 This PR updates the CFG building logic and analysis based warning logic to not consider the default path for `switch` statements to be unreachable when all enumerators are covered. I.e.: ```cpp enum clas

[clang-tools-extra] [clang-pseudo] clang-format files (PR #87900)

2025-01-15 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin closed https://github.com/llvm/llvm-project/pull/87900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-pseudo] Add a --print-terminal-tokens option (PR #87898)

2025-01-15 Thread Jeremy Rifkin via cfe-commits
jeremy-rifkin wrote: Clang pseudo has apparently been removed https://github.com/llvm/llvm-project/pull/87898 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-pseudo] Add a --print-terminal-tokens option (PR #87898)

2025-01-15 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin closed https://github.com/llvm/llvm-project/pull/87898 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-pseudo] clang-format files (PR #87900)

2025-01-15 Thread Jeremy Rifkin via cfe-commits
jeremy-rifkin wrote: Clang pseudo has apparently been removed https://github.com/llvm/llvm-project/pull/87900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-pseudo] Add a --print-terminal-tokens option (PR #87898)

2024-04-06 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin updated https://github.com/llvm/llvm-project/pull/87898 >From 2ebb15e08b5e2d8a9fe6cfddbe0dd2a8942b2542 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rif...@users.noreply.github.com> Date: Sat, 6 Apr 2024 17:02:20 -0500 Subject: [PATCH 1/3] Add a --print-

[clang-tools-extra] [clang-pseudo] Add a --print-terminal-tokens option (PR #87898)

2024-04-06 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin updated https://github.com/llvm/llvm-project/pull/87898 >From 2ebb15e08b5e2d8a9fe6cfddbe0dd2a8942b2542 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rif...@users.noreply.github.com> Date: Sat, 6 Apr 2024 17:02:20 -0500 Subject: [PATCH 1/2] Add a --print-

[clang-tools-extra] [clang-pseudo] clang-format files (PR #87900)

2024-04-06 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin edited https://github.com/llvm/llvm-project/pull/87900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-pseudo] clang-format file (PR #87900)

2024-04-06 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin created https://github.com/llvm/llvm-project/pull/87900 This PR just clang-formats the `clang-tools-extra/pseudo` directory to make contribution easier. One issue I ran into is clang-format kept changing this region, despite the `clang-format off` directives,

[clang-tools-extra] [clang-pseudo] Add a --print-terminal-tokens option (PR #87898)

2024-04-06 Thread Jeremy Rifkin via cfe-commits
https://github.com/jeremy-rifkin created https://github.com/llvm/llvm-project/pull/87898 This PR adds a `--print-terminal-tokens` option to clang-pseudo which prints tokens in a parse forest in addition to providing the token index: ``` › bin/clang-pseudo --source test.cpp --print-forest [ 0,