[RISCV] Simplify usage of SplatPat_simm5_plus1. NFC (#125340)
[llvm-project.git] / clang / test / SemaCXX / constexpr-late-instantiation.cpp
blob9aec0c90e61dc7dc1439bbcb923f42c974d1a3c1
1 // RUN: %clang_cc1 %s -fsyntax-only -verify
2 // RUN: %clang_cc1 %s -fexperimental-new-constant-interpreter -fsyntax-only -verify
4 template <typename T>
5 constexpr T foo(T a); // expected-note {{declared here}}
7 int main() {
8 int k = foo<int>(5); // Ok
9 constexpr int j = // expected-error {{constexpr variable 'j' must be initialized by a constant expression}}
10 foo<int>(5); // expected-note {{undefined function 'foo<int>' cannot be used in a constant expression}}
13 template <typename T>
14 constexpr T foo(T a) {
15 return a;