Files
codeql/cpp/ql/test/query-tests/Best Practices/SloppyGlobal/main.cpp
2025-08-15 11:20:31 +01:00

24 lines
362 B
C++

// main.cpp
int x; // BAD: too short
int ys[1000000]; // BAD: too short
int descriptive_name; // GOOD: sufficient
static int z; // GOOD: not a global
int v1;
int v2;
template <typename T>
T v3;
template <typename T>
T v4;
template <typename T>
T v5;
void use_some_fs() {
v2 = 100;
v4<int> = 200;
v5<int> = 300;
v5<const char *> = "string";
}