Skip to content

Commit

Permalink
Add "weird" test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Fznamznon committed Jun 18, 2024
1 parent 8dc7026 commit 52b504a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions clang/test/Preprocessor/embed_weird.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,19 @@ constexpr unsigned char ch =
#embed FILE_NAME limit(LIMIT) clang::offset(OFFSET) EMPTY_SUFFIX
;
static_assert(ch == 0);

void foobar(float x, char y, char z); // cxx-note {{candidate function not viable: requires 3 arguments, but 1 was provided}}
// c-note@-1 {{declared here}}
void g1() { foobar((float) // cxx-error {{no matching function for call to 'foobar'}}
#embed "numbers.txt" limit(3) // expected-warning {{left operand of comma operator has no effect}}
); // c-error {{too few arguments to function call, expected 3, have 1}}
}

#if __cplusplus
struct S { S(char x); ~S(); };
void f1() {
S s[] = {
#embed "null_byte.bin"
};
}
#endif

0 comments on commit 52b504a

Please sign in to comment.