[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / clang / test / Sema / overloaded-func-transparent-union.c
blob14ea760944bdbb24ab4397d46de7d943c58c2168
1 // RUN: %clang_cc1 %s -fsyntax-only -verify
2 // expected-no-diagnostics
3 // PR9406
5 typedef struct {
6 char *str;
7 char *str2;
8 } Class;
10 typedef union {
11 Class *object;
12 } Instance __attribute__((transparent_union));
14 __attribute__((overloadable)) void Class_Init(Instance this, char *str, void *str2) {
15 this.object->str = str;
16 this.object->str2 = str2;
19 __attribute__((overloadable)) void Class_Init(Instance this, char *str) {
20 this.object->str = str;
21 this.object->str2 = str;
24 int main(void) {
25 Class obj;
26 Class_Init(&obj, "Hello ", " World");