[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-09-22 Thread NohHyeon Kwon via cfe-commits
https://github.com/swote-git updated https://github.com/llvm/llvm-project/pull/155570 >From 36f751e7b92d8907bfe60f3c28748519578097c3 Mon Sep 17 00:00:00 2001 From: swote Date: Wed, 27 Aug 2025 16:34:13 +0900 Subject: [PATCH 1/5] [clang][test] Add tests for comma operator rejection in preproces

[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-09-22 Thread NohHyeon Kwon via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++98 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++11 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++14 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++17 +// RUN: %clang_

[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-09-22 Thread NohHyeon Kwon via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++98 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++11 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++14 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++17 +// RUN: %clang_

[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-09-22 Thread NohHyeon Kwon via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++98 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++11 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++14 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++17 +// RUN: %clang_

[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-09-22 Thread NohHyeon Kwon via cfe-commits
https://github.com/swote-git updated https://github.com/llvm/llvm-project/pull/155570 >From 36f751e7b92d8907bfe60f3c28748519578097c3 Mon Sep 17 00:00:00 2001 From: swote Date: Wed, 27 Aug 2025 16:34:13 +0900 Subject: [PATCH 1/4] [clang][test] Add tests for comma operator rejection in preproces

[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-09-22 Thread NohHyeon Kwon via cfe-commits
swote-git wrote: @DavidSpickett @Endilll i made changes for adding context(cwg3017) and adding tests(`#elif` , `#if ,`). Please review when you have time. https://github.com/llvm/llvm-project/pull/155570 ___ cfe-commits mailing list cfe-commits@lists

[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-09-22 Thread NohHyeon Kwon via cfe-commits
swote-git wrote: @Endilll Thanks for pointing out CWG 3017. "Test 2" is testing exactly the same case as the CWG 3017 example: ```c // Test 2: Comma in conditional expression // expected-error@+1 {{comma operator in operand of #if}} #if 1 ? 1, 0 : 3 #endif ``` Should I add a comment referencing

[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-09-22 Thread NohHyeon Kwon via cfe-commits
https://github.com/swote-git updated https://github.com/llvm/llvm-project/pull/155570 >From 36f751e7b92d8907bfe60f3c28748519578097c3 Mon Sep 17 00:00:00 2001 From: swote Date: Wed, 27 Aug 2025 16:34:13 +0900 Subject: [PATCH 1/3] [clang][test] Add tests for comma operator rejection in preproces

[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-09-22 Thread NohHyeon Kwon via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++98 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++11 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++14 +// RUN: %clang_cc1 -E -pedantic-errors %s -verify -std=c++17 +// RUN: %clang_

[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-09-21 Thread NohHyeon Kwon via cfe-commits
swote-git wrote: @Sirraide Thanks for your review! Should I move this to clang/test/CXX/drs/cwg1436.cpp and format it according to the DR test conventions? https://github.com/llvm/llvm-project/pull/155570 ___ cfe-commits mailing list cfe-commits@lis

[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-08-27 Thread NohHyeon Kwon via cfe-commits
swote-git wrote: Currently, this only about adding test code. While adding these tests, I noticed two potential improvements to the current error message `"comma operator in operand of #if"`: 1. The same message appears for `#elif`, `#ifdef`, etc. 2. Per CWG 1436, comma operators are explicitl

[clang] [clang][test] Add test for comma operator rejection in preprocessor conditionals (PR #155570)

2025-08-27 Thread NohHyeon Kwon via cfe-commits
https://github.com/swote-git created https://github.com/llvm/llvm-project/pull/155570 Add test coverage to ensure comma operators remain properly rejected in `#if` directives. Per CWG 1436, comma is not among the permitted operators in preprocessor conditional expressions. This test prevents