6.33 Manual overload resolution in embedded assembler

The following example shows the use of C++ casts to do overload resolution for nonvirtual function calls.

void g(int);
void g(long);
struct T
    int mf(int);
    int mf(int,int);
__asm void  f(T*, int, int)
    BL __cpp(static_cast<int (T::*)(int, int)>(&T::mf)) // calls T::mf(int, int)
    BL __cpp(static_cast<void (*)(int)>(g)) // calls g(int)
    BX lr
Related concepts
6.26 Embedded assembler support in the compiler
6.31 Access to C and C++ compile-time constant expressions from embedded assembler
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.