xref: /aosp_15_r20/external/clang/test/SemaObjCXX/const-cast.mm (revision 67e74705e28f6214e480b399dd47ea732279e315)
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3@class Foo;
4
5void test() {
6    const Foo *foo1 = 0;
7    Foo *foo2 = foo1; // expected-error {{cannot initialize}}
8}
9
10void test1() {
11    const Foo *foo1 = 0;
12    Foo *foo2 = const_cast<Foo*>(foo1);
13}
14