@@ -44,7 +44,12 @@ static const void *ptr = 0o0; /* ext-warning {{octal integer literals are a C2y
44
44
#endif
45
45
46
46
// 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 ;
48
53
49
54
// Test a preprocessor use of 0 by itself, which is also not deprecated.
50
55
#if 0
@@ -65,7 +70,6 @@ static_assert(__extension__ _Generic(typeof(l), const int : 1, default : 0)); //
65
70
66
71
// Note that 0o by itself is an invalid literal.
67
72
int m = 0 o ; /* expected-error {{invalid suffix 'o' on integer constant}}
68
- c2y-warning {{octal literals without a '0o' prefix are deprecated}}
69
73
*/
70
74
71
75
// Ensure negation works as expected.
@@ -83,13 +87,11 @@ int n = 0o18; /* expected-error {{invalid digit '8' in octal constant}}
83
87
cpp-warning {{octal integer literals are a Clang extension}}
84
88
*/
85
89
int o1 = 0 o8 ; /* expected-error {{invalid suffix 'o8' on integer constant}}
86
- c2y-warning {{octal literals without a '0o' prefix are deprecated}}
87
90
*/
88
91
// FIXME: however, it matches the behavior for hex literals in terms of the
89
92
// error reported. Unfortunately, we then go on to think 0 is an octal literal
90
93
// without a prefix, which is again a bit confusing.
91
94
int o2 = 0 xG ; /* expected-error {{invalid suffix 'xG' on integer constant}}
92
- c2y-warning {{octal literals without a '0o' prefix are deprecated}}
93
95
*/
94
96
95
97
// 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
130
132
*/
131
133
static_assert (p == 01234567 ); // c2y-warning {{octal literals without a '0o' prefix are deprecated}}
132
134
int 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}}
134
135
*/
135
136
136
137
#define M 0o123
0 commit comments