1 2 3 4 5 | template<class T, char* p> int X() { }; char p[] = "Vivisectionist"; int m() {X<int,p>();} |
dGVtcGxhdGU8Y2xhc3MgVCwgY2hhciogcD4gaW50IFgoKSB7Cn07CmNoYXIgcFtdID0gIlZpdmlzZWN0aW9uaXN0IjsKaW50IG0oKSB7WDxpbnQscD4oKTt9CiA=
prog.cpp: In function ‘int X()’: prog.cpp:2: warning: no return statement in function returning non-void prog.cpp: In function ‘int m()’: prog.cpp:4: warning: control reaches end of non-void function prog.cpp: In function ‘int X() [with T = int, char* p = ((char*)(& p))]’: prog.cpp:2: warning: control reaches end of non-void function /usr/lib/gcc/i686-pc-linux-gnu/4.3.4/../../../crt1.o: In function `_start': (.text+0x18): undefined reference to `main' collect2: ld returned 1 exit status
-
result: Compilation error (maybe you wish to see an example for C++ 4.7.2)


