File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1555,6 +1555,15 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) {
15551555 // __LINE__ expands to a simple numeric value.
15561556 OS << (PLoc.isValid ()? PLoc.getLine () : 1 );
15571557 Tok.setKind (tok::numeric_constant);
1558+ } else if (II == Ident__RANDOM__NUMERIC__) {
1559+ // __RANDOM__NUMERIC__: A random number (an integer constant).
1560+ // This is a llvm-msvc specific extension.
1561+ std::random_device RD;
1562+ std::uniform_int_distribution<uint64_t > Dist (
1563+ std::numeric_limits<uint64_t >::min (),
1564+ std::numeric_limits<uint64_t >::max ());
1565+ OS << Dist (RD);
1566+ Tok.setKind (tok::numeric_constant);
15581567 } else if (II == Ident__FILE__ || II == Ident__BASE_FILE__ ||
15591568 II == Ident__FILE_NAME__ || II == Ident__FUNCTION__) {
15601569 // C99 6.10.8: "__FILE__: The presumed name of the current source file (a
You can’t perform that action at this time.
0 commit comments