| 1 |
// RUN: %check_clang_tidy %s cert-msc50-cpp %t |
| 2 |
|
| 3 |
int rand(); |
| 4 |
int rand(int); |
| 5 |
|
| 6 |
namespace std { |
| 7 |
using ::rand; |
| 8 |
} |
| 9 |
|
| 10 |
namespace nonstd { |
| 11 |
int rand(); |
| 12 |
} |
| 13 |
|
| 14 |
void testFunction1() { |
| 15 |
int i = std::rand(); |
| 16 |
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: rand() has limited randomness; use C++11 random library instead [cert-msc50-cpp] |
| 17 |
|
| 18 |
int j = ::rand(); |
| 19 |
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: rand() has limited randomness; use C++11 random library instead [cert-msc50-cpp] |
| 20 |
|
| 21 |
int k = rand(i); |
| 22 |
|
| 23 |
int l = nonstd::rand(); |
| 24 |
|
| 25 |
int m = rand(); |
| 26 |
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: rand() has limited randomness; use C++11 random library instead [cert-msc50-cpp] |
| 27 |
} |
| 28 |
|