]> granicus.if.org Git - clang/commitdiff
Add a couple of sema tests for qualifiers with conditionals containing
authorEli Friedman <eli.friedman@gmail.com>
Sun, 10 Feb 2008 23:14:16 +0000 (23:14 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Sun, 10 Feb 2008 23:14:16 +0000 (23:14 +0000)
void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46939 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/conditional-expr.c

index a113adeeb3870b67796ddba6224b096d4ed34f2a..0c9052845c336e5a263d80176df66f5ab2558629 100644 (file)
@@ -18,5 +18,9 @@ void foo() {
   dp = 0 ? (double *)0 : (void *)0;
   vp = 0 ? (double *)0 : (void *)0;
   ip = 0 ? (double *)0 : (void *)0; // expected-warning {{incompatible pointer types assigning 'double *', expected 'int *'}}
+
+  const int *cip;
+  vp = (0 ? vp : cip); // expected-warning {{discards qualifiers}}
+  vp = (0 ? cip : vp); // expected-warning {{discards qualifiers}}
 }