Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| clang/test/AST/Interp/literals.cpp | ||
|---|---|---|
| 415 | I'd also like some test cases where the result of the operation is discarded. e.g., constexpr int func() {
  int i = 12;
  i += 10;
  return i;
}
static_assert(func() == 22);and a test with a float-point type (okay for it to fail for the moment): constexpr float func() {
  float f = 1.0f;
  f += 10.0f;
  return f;
}
static_assert(func() == 11.0f); | |
| 429 | We also need tests for failure situations: constexpr int func() {
  int i = __INT_MAX__;
  i += 1; // oops
  return i;
}
constexpr int another() {
  int i = __INT_MIN__;
  i -= 1; // oops
  return i;
} | |
| clang/test/AST/Interp/literals.cpp | ||
|---|---|---|
| 429 | woops, I was sure I added this but it was for the ++/-- patch it seems. | |
I'd also like some test cases where the result of the operation is discarded. e.g.,
constexpr int func() { int i = 12; i += 10; return i; } static_assert(func() == 22);and a test with a float-point type (okay for it to fail for the moment):
constexpr float func() { float f = 1.0f; f += 10.0f; return f; } static_assert(func() == 11.0f);