Skip to content

Commit f350930

Browse files
committed
Add reproducer test sets
1 parent 773d310 commit f350930

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//type:cp
2+
//remark:[GH #182] "GCC diagnostic" pragmas were not recognized
3+
//options:--g++ --gnu_version=150000:--g++ --gnu_version=120000:--gcc --gnu_version=150000:--clang
4+
//options_all:--diag_error=unrecognized_gcc_pragma
5+
#pragma GCC diagnostic push
6+
#pragma GCC diagnostic ignored "-Wunused-parameter"
7+
int f(int unused) { return 0; }
8+
#pragma GCC diagnostic pop
9+
10+
#define IGNORE_SHADOW _Pragma("GCC diagnostic ignored \"-Wshadow\"")
11+
void g(int *p) {
12+
_Pragma("GCC diagnostic push")
13+
IGNORE_SHADOW
14+
*p = 0;
15+
_Pragma("GCC diagnostic pop")
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//type:fp
2+
//remark:[GH #182] Malformed and version-specific "GCC diagnostic" pragmas
3+
//options:--g++ --gnu_version=150000:--g++ --gnu_version=120000:--g++ --gnu_version=40500:--clang
4+
#pragma GCC diagnostic push // GCC 4.6 and later
5+
#pragma GCC diagnostic warning "-Wshadow"
6+
#pragma GCC diagnostic error "-Wreturn-type"
7+
#pragma GCC diagnostic ignored_attributes "vendor::" // GCC 13 and later
8+
#pragma GCC diagnostic fatal "-Wshadow" // clang only
9+
#pragma GCC diagnostic pop extra text // Trailing text is ignored.
10+
#pragma GCC diagnostic // Kind missing.
11+
#pragma GCC diagnostic bogus // Kind unknown.
12+
#pragma GCC diagnostic ignored // Option missing.
13+
#pragma GCC diagnostic ignored -Wshadow // Option not a string literal.
14+
#pragma GCC diagnostic ignored L"-Wshadow" // Option not a narrow string.
15+
int x;

0 commit comments

Comments
 (0)