shadowm

Untitled

Sep 14th, 2016
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. shadowm@nanacore ~ % cat test.cpp
  2. #include <iostream>
  3.  
  4. struct Foo
  5. {
  6. int a, b, c;
  7. };
  8.  
  9. int main(int, char**)
  10. {
  11. Foo f = { .a = 42};
  12. std::cerr << f.a << ' ' << f.b << '\n';
  13. return 0;
  14. }
  15. shadowm@nanacore ~ % g++-6 test.cpp -o test -std=c++98 && echo OK
  16. OK
  17. shadowm@nanacore ~ % g++-5 test.cpp -o test -std=c++98 && echo OK
  18. OK
  19. shadowm@nanacore ~ % g++-4.4 test.cpp -o test -std=c++98
  20. test.cpp: In function ‘int main(int, char**)’:
  21. test.cpp:10: error: expected primary-expression before ‘.’ token
Advertisement
Add Comment
Please, Sign In to add comment