brintos

brintos / llvm-project-archived public Read only

0
0
Text · 360 B · 6d1b29e Raw
18 lines · cpp
1// RUN: %clang_cc1 %s -std=c++20 -fsyntax-only -verify2// expected-no-diagnostics3 4// Reported by: https://github.com/llvm/llvm-project/issues/570135// The following code should not crash clang6struct X {7  char arr[2];8  constexpr X() {}9  constexpr void modify() {10    arr[0] = 0;11  }12};13constexpr X f(X t) {14    t.modify();15    return t;16}17auto x = f(X());18