gcc/testsuite/g++.dg/lookup/extern-c-static1.C
raw| 1 | // PR c++/93643 |
| 2 | |
| 3 | void* callback(const char* name); |
| 4 | |
| 5 | extern "C" { |
| 6 | |
| 7 | inline void f1() |
| 8 | { |
| 9 | static void (*f)(); |
| 10 | f = (void(*)()) callback("f1"); |
| 11 | f(); |
| 12 | } |
| 13 | |
| 14 | inline void f2() |
| 15 | { |
| 16 | static void (*f)(); |
| 17 | f = (void(*)()) callback("f2"); |
| 18 | f(); |
| 19 | } |
| 20 | |
| 21 | } // extern "C" |
| 22 | |
| 23 | int main() |
| 24 | { |
| 25 | f1(); |
| 26 | f2(); |
| 27 | } |