Source file misc/cgo/errors/testdata/issue28721.go

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // cgo should reject the use of mangled C names.
     6  
     7  package main
     8  
     9  /*
    10  typedef struct a {
    11  	int i;
    12  } a;
    13  void fn(void) {}
    14  */
    15  import "C"
    16  
    17  type B _Ctype_struct_a // ERROR HERE
    18  
    19  var a _Ctype_struct_a // ERROR HERE
    20  
    21  type A struct {
    22  	a *_Ctype_struct_a // ERROR HERE
    23  }
    24  
    25  var notExist _Ctype_NotExist // ERROR HERE
    26  
    27  func main() {
    28  	_Cfunc_fn() // ERROR HERE
    29  }
    30  

View as plain text