Skip to content

Commit b50be5d

Browse files
committed
Add tests for valid FPs with leading 0's
1 parent eb48683 commit b50be5d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

clang/test/C/C2y/n3353.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ auto f4 = 0o0E1; /* expected-error {{invalid suffix 'E1' on integer constant}}
114114
cpp-warning {{octal integer literals are a Clang extension}}
115115
*/
116116

117+
// Show that valid floating-point literals with a leading 0 do not produce octal-related warnings.
118+
auto f5 = 0.;
119+
auto f7 = 00.;
120+
auto f8 = 01.;
121+
auto f9 = 0e1;
122+
auto f10 = 0E1;
123+
auto f11 = 00e1;
124+
auto f12 = 00E1;
125+
117126
// Ensure digit separators work as expected.
118127
constexpr int p = 0o0'1'2'3'4'5'6'7; /* compat-warning {{octal integer literals are incompatible with standards before C2y}}
119128
ext-warning {{octal integer literals are a C2y extension}}

0 commit comments

Comments
 (0)