r179139 - Improve the diagnostics of the number-reading preprocessor directives.

Jordan Rose jordan_rose at apple.com
Tue Apr 9 18:18:42 PDT 2013


On Apr 9, 2013, at 18:04 , Michael Ilseman <milseman at apple.com> wrote:

> // Line markers are digit strings interpreted as decimal numbers, this is
> // 10, not 8.
> #line 010  // expected-warning {{#line directive interprets number as decimal, not octal}}
> +# 010      // expected-warning {{GNU line marker directive interprets number as decimal, not octal}}
> extern int array[__LINE__ == 10 ? 1:-1];

Oops, and of course now I see the issue—the following line with __LINE__ is a poor man's static_assert, checking that the line marker actually did its job. Can you put that in for both kinds of directive?

Jordan



More information about the cfe-commits mailing list