fork download
  1. #include <stdio.h>
  2. #include <stddef.h>
  3.  
  4. template< int base_offs > struct pin {
  5. int y1;
  6. };
  7.  
  8. struct wrap {
  9. int x1;
  10. char x2;
  11.  
  12. char base1[0];
  13. pin< offsetof(wrap,base1) > r3;
  14.  
  15. char base2[0];
  16. pin< offsetof(wrap,base2) > r4;
  17. };
  18.  
  19.  
  20.  
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from prog.cpp:2:0:
prog.cpp:13:8: error: invalid use of incomplete type ‘struct wrap’
   pin< offsetof(wrap,base1) > r3;
        ^
prog.cpp:8:8: error: forward declaration of ‘struct wrap’
 struct wrap {
        ^
prog.cpp:13:29: error: template argument 1 is invalid
   pin< offsetof(wrap,base1) > r3;
                             ^
In file included from prog.cpp:2:0:
prog.cpp:16:8: error: invalid use of incomplete type ‘struct wrap’
   pin< offsetof(wrap,base2) > r4;
        ^
prog.cpp:8:8: error: forward declaration of ‘struct wrap’
 struct wrap {
        ^
prog.cpp:16:29: error: template argument 1 is invalid
   pin< offsetof(wrap,base2) > r4;
                             ^
stdout
Standard output is empty