Debian Codegraph @

clang/test/Interpreter/verify-diagnostics.cpp

raw
1 // REQUIRES: host-supports-jit
2 // RUN: cat %s | clang-repl -Xcc -Xclang -Xcc -verify
3
4 auto x = unknown_val;
5 // expected-error@input_line_4:1 {{use of undeclared identifier 'unknown_val'}}
6
7 int get_int() { return 42; }
8 char* ptr = get_int();
9 // expected-error@input_line_8:1 {{cannot initialize a variable of type 'char *' with an rvalue of type 'int'}}
10
11 // Verify without input_line_*
12 int y = ;
13 // expected-error {{expected expression}}
14
15 const char* a = "test"; // expected-note {{previous definition is here}}
16 const char* a = ""; // expected-error {{redefinition of 'a'}}