mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
This allows a C++ constexpr to be used as an argument to a non-type template parameter. https://github.com/carbon-language/carbon-lang/issues/6717
22 lines
722 B
C++
22 lines
722 B
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#ifndef CARBON_TOOLCHAIN_CHECK_CPP_CONSTANT_H_
|
|
#define CARBON_TOOLCHAIN_CHECK_CPP_CONSTANT_H_
|
|
|
|
#include "clang/AST/APValue.h"
|
|
#include "toolchain/check/context.h"
|
|
#include "toolchain/sem_ir/ids.h"
|
|
|
|
namespace Carbon::Check {
|
|
|
|
// Converts an `APValue` to a Carbon `ConstantId`.
|
|
auto MapAPValueToConstant(Context& context, SemIR::LocId loc_id,
|
|
const clang::APValue& ap_value, clang::QualType type)
|
|
-> SemIR::ConstantId;
|
|
|
|
} // namespace Carbon::Check
|
|
|
|
#endif // CARBON_TOOLCHAIN_CHECK_CPP_CONSTANT_H_
|