Compiler Engineer clang front end. Interests: C++, C, and undefined behavior. Martial Artist, Book Worm and Dad. @shafik@hachyderm.io he/him
#274 Given the following in C++ typedef void F(); F fv { } // Well-formed definition? Without checking: A. Yes B. No C. Show results #Cplusplus #Cpppolls [ ] A [ ] B [ ] C
#271 Given the following in C++ struct S { static int i; }; auto S::i = 23; // Well-formed? Note use of auto Without checking: A. Yes B. No C. Show results #Cplusplus #Cpppolls [ ] A [ ] B [ ] C
#270 Given the following in C++ template void f(T); void g() { f(1); f(); // Well-formed? f now takes zero arguments? } Without checking: A. Yes B. No C. Show results #Cplusplus #Cpppolls [ ] A [ ] B...
#269 Given the following in C++ int f(int i) { switch (i) { case 1: break; // Is the following line well-formed? [[likely,unlikely]] case 2: return 1; } return 2; } Without checking: A. Yes B. No C....
#268 Given the following in C++ int f() { [[deprecated]] int a; // Well-formed? Can we deprecate a local variable? return a; } Without checking: A. Yes B. No C. Show results #Cplusplus #Cpppolls [ ]...
#267 Given the following in C++ void f(const void); // Well-formed? A. Yes B. No C. Show results #Cplusplus #Cpppolls [ ] A [ ] B [ ] C
Retro C++ quiz #12 In C++ given #include auto f() { std::variant v; return v.index(); // What value is returned? } Without checking: A: std::variant_npos B: 0 C: Show answers #cplusplus #Cpppolls [ ]...
#266 Given the following in C++ struct A { int; // Well-formed? }; A. Yes B. No C. Show results #Cplusplus #Cpppolls [ ] A [ ] B [ ] C
#264 Given the following in C++ void f() { sizeof([]{}); // Well-formed? } Without checking: A. Yes B. No C. Show results #Cplusplus #Cpppolls [ ] A [ ] B [ ] C
#265 Given the following in C++ struct A { virtual void f() = 0; }; void A::f(){} // Well-formed, definition of pure virtual function A. Yes B. No C. Show results #Cplusplus #Cpppolls [ ] A [ ] B [ ]...