@@ -44,7 +44,12 @@ static const void *ptr = 0o0; /* ext-warning {{octal integer literals are a C2y
4444#endif
4545
4646// 0 by itself is not deprecated, of course.
47- int k = 0 ;
47+ int k1 = 0 ;
48+ unsigned int k2 = 0u ;
49+ long k3 = 0l ;
50+ unsigned long k4 = 0ul ;
51+ long long k5 = 0ll ;
52+ unsigned long long k6 = 0ull ;
4853
4954// Test a preprocessor use of 0 by itself, which is also not deprecated.
5055#if 0
@@ -65,7 +70,6 @@ static_assert(__extension__ _Generic(typeof(l), const int : 1, default : 0)); //
6570
6671// Note that 0o by itself is an invalid literal.
6772int m = 0 o ; /* expected-error {{invalid suffix 'o' on integer constant}}
68- c2y-warning {{octal literals without a '0o' prefix are deprecated}}
6973 */
7074
7175// Ensure negation works as expected.
@@ -83,13 +87,11 @@ int n = 0o18; /* expected-error {{invalid digit '8' in octal constant}}
8387 cpp-warning {{octal integer literals are a Clang extension}}
8488 */
8589int o1 = 0 o8 ; /* expected-error {{invalid suffix 'o8' on integer constant}}
86- c2y-warning {{octal literals without a '0o' prefix are deprecated}}
8790 */
8891// FIXME: however, it matches the behavior for hex literals in terms of the
8992// error reported. Unfortunately, we then go on to think 0 is an octal literal
9093// without a prefix, which is again a bit confusing.
9194int o2 = 0 xG ; /* expected-error {{invalid suffix 'xG' on integer constant}}
92- c2y-warning {{octal literals without a '0o' prefix are deprecated}}
9395 */
9496
9597// Show that floating-point suffixes on octal literals are rejected.
@@ -130,7 +132,6 @@ constexpr int p = 0o0'1'2'3'4'5'6'7; /* compat-warning {{octal integer literals
130132 */
131133static_assert (p == 01234567 ); // c2y-warning {{octal literals without a '0o' prefix are deprecated}}
132134int q = 0 o '0'1 ; /* expected-error {{invalid suffix 'o'0'1' on integer constant}}
133- c2y-warning {{octal literals without a '0o' prefix are deprecated}}
134135 */
135136
136137#define M 0o123
0 commit comments