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
@@ -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_
@@ -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_
@@ -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_
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
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
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
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
@@ -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_
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
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
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
12 matches
Mail list logo