erichkeane added a comment.

So things cast to 'void' can have side effects, right?  Does the call to 
discard still evaluate them?

https://godbolt.org/z/a3ej9bxKe

  constexpr int foo(int start) {
      int i = start;
  
      (void)i++;
      (void)i++,(void)i++;
      return i;
  }
  constexpr int Value = foo(5);
  static_assert(Value == 8);


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148925/new/

https://reviews.llvm.org/D148925

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to