mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:56:42 +00:00

Fix [issue](https://github.com/llvm/llvm-project/issues/77189) AutoType is possible cv qualified. Co-authored-by: huqizhi <836744285@qq.com>
23 lines
466 B
C++
23 lines
466 B
C++
// RUN: %clang_cc1 -fsyntax-only -std=c++17 -verify %s
|
|
// RUN: %clang_cc1 -fsyntax-only -std=c++20 -verify %s
|
|
// expected-no-diagnostics
|
|
|
|
struct false_type {
|
|
static constexpr bool value = false;
|
|
};
|
|
|
|
struct true_type {
|
|
static constexpr bool value = true;
|
|
};
|
|
|
|
template <auto& Value, int>
|
|
struct test : false_type {};
|
|
|
|
template <auto& Value>
|
|
struct test<Value, 0> : true_type {};
|
|
|
|
int main() {
|
|
static constexpr int v = 42;
|
|
static_assert(test<v, 0>::value);
|
|
}
|