mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Support float template params (#6801)
https://github.com/carbon-language/carbon-lang/issues/6717
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
|
||||
// EXTRA-ARGS: --clang-arg=-std=c++20
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
@@ -75,6 +76,16 @@ impl C as Core.ImplicitAs(i32) {
|
||||
}
|
||||
var s: Cpp.Simple({} as C) = Cpp.MakeSimple123();
|
||||
|
||||
// --- float.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<float N> struct Struct {};
|
||||
Struct<123.5f> MakeStruct() { return Struct<123.5f>(); }
|
||||
''';
|
||||
let v: Cpp.Struct(123.5) = Cpp.MakeStruct();
|
||||
|
||||
// --- valid.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
Reference in New Issue
Block a user