fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class MyClass
  5. {
  6. public:
  7.  
  8. enum myEnum
  9. {
  10. a = 0b0;
  11. b = 0b1;
  12. };
  13.  
  14. union myUnion
  15. {
  16. uint32_t all;
  17.  
  18. struct myStruct
  19. {
  20. uint32_t start : 0b1;
  21. uint32_t enumValue : myEnum::a;
  22. } bits;
  23. };
  24. }
  25.  
  26. int main() {
  27. MyClass m;
  28. return 0;
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:10:20: error: expected ‘}’ before ‘;’ token
             a = 0b0;
                    ^
prog.cpp:11:13: error: ‘b’ does not name a type
             b = 0b1;
             ^
prog.cpp:21:38: error: ‘myEnum’ has not been declared
                 uint32_t enumValue : myEnum::a;
                                      ^~~~~~
prog.cpp:24:1: error: expected declaration before ‘}’ token
 }
 ^
stdout
Standard output is empty