xref: /aosp_15_r20/external/clang/test/SemaCXX/reinterpret-fn-obj-pedantic.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 -pedantic %s
2*67e74705SXin Li 
fnptrs()3*67e74705SXin Li void fnptrs()
4*67e74705SXin Li {
5*67e74705SXin Li   typedef void (*fnptr)();
6*67e74705SXin Li   fnptr fp = 0;
7*67e74705SXin Li   void *vp = reinterpret_cast<void*>(fp); // expected-warning {{cast between pointer-to-function and pointer-to-object is an extension}}
8*67e74705SXin Li   (void)reinterpret_cast<fnptr>(vp); // expected-warning {{cast between pointer-to-function and pointer-to-object is an extension}}
9*67e74705SXin Li }
10