3 // Copyright 2022 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Test that not-in-heap types cannot be used as type
8 // arguments. (pointer-to-nih types are okay though.)
19 var _ atomic.Pointer[cgo.Incomplete] // ERROR "cannot use incomplete \(or unallocatable\) type as a type argument: runtime/cgo\.Incomplete"
20 var _ atomic.Pointer[*cgo.Incomplete] // ok
22 func implicit(ptr *cgo.Incomplete) {
23 g(ptr) // ERROR "cannot use incomplete \(or unallocatable\) type as a type argument: runtime/cgo\.Incomplete"
27 func g[T any](_ *T) {}