The attached test case otherwise results in a function with one jump op but no source info at all.
18 lines
754 B
C++
18 lines
754 B
C++
// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify %s -fconstexpr-steps=100
|
|
|
|
|
|
constexpr int foo() { // expected-error {{never produces a constant expression}}
|
|
while (1) {} // expected-note 2{{constexpr evaluation hit maximum step limit}}
|
|
return 0;
|
|
}
|
|
static_assert (foo() == 0, ""); // expected-error {{not an integral constant expression}} \
|
|
// expected-note {{in call to}}
|
|
|
|
constexpr void addr() { // expected-error {{never produces a constant expression}}
|
|
for (;;) // expected-note 2{{constexpr evaluation hit maximum step limit}}
|
|
;
|
|
}
|
|
static_assert((addr(), 1) == 1); // expected-error {{not an integral constant expression}} \
|
|
// expected-note {{in call to}}
|
|
|