[cfe-commits] r60319 - in /cfe/trunk: include/clang/Basic/DiagnosticKinds.def lib/Sema/Sema.h lib/Sema/SemaExpr.cpp test/Sema/i-c-e3.c

Eli Friedman eli.friedman at gmail.com
Sun Nov 30 19:41:26 PST 2008


On Sun, Nov 30, 2008 at 6:17 PM, Anders Carlsson <andersca at mac.com> wrote:
=============================================================================
> --- cfe/trunk/test/Sema/i-c-e3.c (original)
> +++ cfe/trunk/test/Sema/i-c-e3.c Sun Nov 30 20:17:22 2008
> @@ -1,3 +1,3 @@
> -// RUN: clang %s -fsyntax-only -verify -pedantic
> +// RUN: clang %s -fsyntax-only -verify -pedantic-errors
>
> -int a() {int p; *(1 ? &p : (void*)(0 && (a(),1))) = 10;} // expected-error {{not assignable}}
> +int a() {int p; *(1 ? &p : (void*)(0 && (a(),1))) = 10;} // expected-error {{null pointer expression is not an integer constant expression (but is allowed as an extension)}} // expected-note{{C does not permit evaluated commas in an integer constant expression}}

This looks wrong; we shouldn't be giving a pedantic error because
something that isn't a null pointer constant looks like one.  How does
the new code handle just "(1 ? &p : (void*)(0 && (a(),1)));"?

-Eli



More information about the cfe-commits mailing list