mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 12:16:06 +00:00

Fixes: https://github.com/llvm/llvm-project/issues/126231 Also found in : https://github.com/microsoft/STL/issues/5271
19 lines
447 B
C++
19 lines
447 B
C++
// RUN: %clang_cc1 -std=c++20 -Wno-ignored-attributes -Wno-unused-value -verify %s
|
|
// expected-no-diagnostics
|
|
namespace std {
|
|
template <class T>
|
|
constexpr const T& as_const(T&) noexcept;
|
|
|
|
// We need two declarations to see the error for some reason.
|
|
template <class T> void as_const(const T&&) noexcept = delete;
|
|
template <class T> void as_const(const T&&) noexcept;
|
|
}
|
|
|
|
namespace GH126231 {
|
|
|
|
void test() {
|
|
int a = 1;
|
|
std::as_const(a);
|
|
}
|
|
}
|