fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A {
  5.  
  6. struct {
  7. int a;
  8. char b;
  9. private:
  10. bool c;
  11. } s;
  12.  
  13. A() : s ({ 3, 'c' }) {}
  14.  
  15. };
  16.  
  17. int main() {
  18. // your code goes here
  19. return 0;
  20. }
Compilation error #stdin compilation error #stdout 0s 3292KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor ‘A::A()’:
prog.cpp:13:21: error: no matching function for call to ‘A::<anonymous struct>::._84(<brace-enclosed initializer list>)’
  A() : s ({ 3, 'c' }) {}
                     ^
prog.cpp:13:21: note: candidates are:
prog.cpp:6:10: note: A::<anonymous struct>::<constructor>()
  struct  {
          ^
prog.cpp:6:10: note:   candidate expects 0 arguments, 1 provided
prog.cpp:6:10: note: constexpr A::<anonymous struct>::<constructor>(const A::<anonymous struct>&)
prog.cpp:6:10: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const A::<anonymous struct>&’
prog.cpp:6:10: note: constexpr A::<anonymous struct>::<constructor>(A::<anonymous struct>&&)
prog.cpp:6:10: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘A::<anonymous struct>&&’
stdout
Standard output is empty