[OpenACC] Implement 'device_type' for 'data' construct
[llvm-project.git] / libc / src / __support / CPP / utility / declval.h
blob9b963b92204f3000d1ceeea4e6ee59ddeda5c0a6
1 //===-- declval utility -----------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_LIBC_SRC___SUPPORT_CPP_UTILITY_DECLVAL_H
9 #define LLVM_LIBC_SRC___SUPPORT_CPP_UTILITY_DECLVAL_H
11 #include "src/__support/CPP/type_traits/add_rvalue_reference.h"
12 #include "src/__support/CPP/type_traits/always_false.h"
13 #include "src/__support/macros/config.h"
15 namespace LIBC_NAMESPACE_DECL {
16 namespace cpp {
18 // declval
19 template <typename T> cpp::add_rvalue_reference_t<T> declval() {
20 static_assert(cpp::always_false<T>,
21 "declval not allowed in an evaluated context");
24 } // namespace cpp
25 } // namespace LIBC_NAMESPACE_DECL
27 #endif // LLVM_LIBC_SRC___SUPPORT_CPP_UTILITY_DECLVAL_H