template<typename T, int j, int i>struct error { int err[i];}; template<typename T>struct S { S(T t = 0) { error<decltype(t), sizeof(t), -1> e; }}; int main() { S<int[2]> s;}
Standard input is empty
prog.cpp: In instantiation of 'error<int [2], 4, -0x000000001>': prog.cpp:9:39: instantiated from 'S<T>::S(T) [with T = int [2]]' prog.cpp:14:13: instantiated from here prog.cpp:3:12: error: creating array with negative size ('-0x000000001')
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!