Juan Manuel Martinez Caamaño 0d3d2f639c
[Clang] Do not warn for serialized builtin or command-line definitions (#137306)
When using `-dD` to generate a preprocessed output, the `#define`
directives
are preserved. This includes built-in and command-line definitions.

Before, clang would warn for reserved identifiers for serialized
built-in
and command-line definitions.
This patch adds an exception to these cases.
2025-05-01 09:55:46 +02:00

12 lines
363 B
OpenEdge ABL

// RUN: %clang_cc1 -fsyntax-only -verify -x cpp-output %s
#pragma clang diagnostic push
#pragma clang diagnostic warning "-Wreserved-macro-identifier"
# 1 "<built-in>" 1
#define __BUILTIN__
# 2 "<command line>" 1
#define __CMD__
# 3 "biz.cpp" 1
#define __SOME_FILE__ // expected-warning {{macro name is a reserved identifier}}
int v;
#pragma clang diagnostic pop