Skip to content

Commit 5a0da33

Browse files
committed
Pre-commit test: [Clang] Do not warn for serialized builtin or command-line definitions
1 parent 211b51e commit 5a0da33

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %clang_cc1 -fsyntax-only -verify -x cpp-output %s
2+
#pragma clang diagnostic push
3+
#pragma clang diagnostic warning "-Wreserved-macro-identifier"
4+
# 1 "<built-in>" 1
5+
#define __BUILTIN__ // expected-warning {{macro name is a reserved identifier}}
6+
# 2 "<command line>" 1
7+
#define __CMD__ // expected-warning {{macro name is a reserved identifier}}
8+
# 3 "biz.cpp" 1
9+
#define __SOME_FILE__ // expected-warning {{macro name is a reserved identifier}}
10+
int v;
11+
#pragma clang diagnostic pop

0 commit comments

Comments
 (0)