30 nov 2008 kl. 19.41 skrev Eli Friedman:

On Sun, Nov 30, 2008 at 6:17 PM, Anders Carlsson <[EMAIL PROTECTED]> 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)));"?


It handles it just fine

test.c:1:17: warning: expression result unused
int a() {int p; (1 ? &p : (void*)(0 && (a(),1)));}
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note that it only gives an error if the -pedantic-errors flag is used.

Anders

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to