fork download
  1. struct s { int i; };
  2.  
  3. template<const s* _arr>
  4. class struct_array
  5. {
  6. public:
  7. static const s arr;
  8. template<int >
  9. struct inner // line 9, without this struct, it works
  10. {
  11. };
  12. };
  13.  
  14. template<const s* _arr>
  15. const s struct_array<_arr>::arr = _arr[0];
  16.  
  17. extern const s s_objs[] = {{ 42 }};
  18.  
  19. int main()
  20. {
  21. struct_array<s_objs> t_obj;
  22. return 0;
  23. }
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty