C and C++ Binaries

Cross-References: C and C++ Kinds and Usages

This section describes the kind and usage values that CodeSonar uses to characterize identifiers in C and C++ programs.

Identifiers in C# and Java code are characterized using a subset of these kinds and usages.



Available Kinds

The following kinds are used to categorize the (non-keyword) tokens in a source file.

builtin Name of a __builtin_*() function [C++ / GNU C] [roles] [examples]
enum Individual enumerator name.   [roles] [examples]
field Field name in an aggregate.   [roles] [examples]
file File name (including extension).   [roles] [examples]
file static variable Name of a file static variable.   [roles] [examples]
function Name of a non-static function.   [roles] [examples]
global variable Name of a global variable.   [roles] [examples]
label Identifier used as a label.   [roles] [examples]
local static variable Name of a locally-scoped static variable.   [roles] [examples]
local variable Name of a local variable   [roles] [examples]
macro Macro name.   [role] [examples]
method Name of a non-static method. [C++] [roles] [examples]
namespace Namespace name. [C++] [roles] [examples]
parameter Parameter name.   [roles] [examples]
static function Name of a static function.   [roles] [examples]
static method Name of a static method. [C++] [roles] [examples]
string literal A string literal.   [roles] [examples]
tag An enum, struct, or union type tag. [C] [roles] [examples]
template type Name of a type parameter for a template. [C++] [roles] [examples]
template value Name of a value parameter for a template. [C++] [roles] [examples]
type Type name.   [roles] [examples]

Kind-Usage Pairs

For each token kind, there are one or more possible usages: roles that a token of that kind can play in code. The following table lists the available usages for each kind.

builtin

Name of a __builtin_*() function. [examples]
[C++ / GNU C] other All code occurrences.

enum

Individual enum symbol. [examples]
definition ...the definition of the symbol.
occurrence ...any other occurrence of the symbol in source code.

field

Field name f in an aggregate. [examples]
  definition ...when defined.
  invocation ...when invoked (for function pointer fields).
  read ...when its value is read.
  sizeof ...in the argument to sizeof() .
  take address ...as the operand of an addressing expression &f.
  write ...when written to.
  write through ...when it is dereferenced and its target written to (for pointer fields)
[C++] constructor initialization ...when initialized in an initialization list
[C++] method invocation ...when one of its methods is invoked on it (for aggregate fields).
  other  ...otherwise.

file

File name fname.fext (including extension). [examples]
  definition ...when the source file called fname.fext is present in the analysis.
  include ...in an include directive #include "fname.fext"

function, static function, method, static method

Name fn of a function or method. There are four kinds

function non-static function [examples]
static function static function [examples]
method [C++] non-static method [examples]
static method [C++] static method [examples]
call ...when the function is called / method is invoked.
declaration ...when declared.
definition ...when defined.
sizeof ...in the argument to sizeof() .
take address ...as the operand of an addressing expression &fn.
[C++] friend ...declared as a friend.
[C++] template argument ...as a value argument for template instantiation.
other  

global variable, local static variable, local variable, file static variable, parameter

Variable name v. There are five kinds, corresponding to different variable scopes and linkages.

global variable [examples]
local static variable [examples]
local variable [examples]
file static variable [examples]
parameter [examples]
declaration ...when declared. [not available for local static variables]
definition ...when defined.
invocation ...when invoked (for function pointer variables).
read ...when its value is read.
sizeof ...as the argument to sizeof().
take address ...as the operand of an addressing expression &v.
write ...when written to.
write through ...when it is dereferenced and its target written to (for pointer variables).
[C++] method invocation ...when one of its methods is invoked (for aggregate variables).
[C++] template argument ...as a value argument for template instantiation [not available for parameters].
other  ...otherwise.

label

Identifier L used as a label. [examples]
definition ...when defined (used to label a statement).
goto ...as the operand in a goto expression.
[GNU] take address ...as the operand of an addressing expression &&L .

macro

Macro name M. [examples]
definition ...when first defined with #define (includes redefining after #undef M).
invocation ...when invoked.
redefinition ...when #define'd twice or more with no intervening #undef.
undefinition ...when undefined with #undef.

namespace

Namespace name ns. [examples]
[C++] definition ...at the initial definition of the namespace.
[C++] extension ...at any subsequent extension of the namespace.
[C++] qualifier ...in the first operand of a name qualifier expression ns::x.
[C++] using ...as the operand in a using namespace expression.

string literal

A string literal. [examples]
  definition ...any occurrence of a string literal in source code (after preprocessing).

template type

Name of a type parameter TT for a template. [examples]
[C++] cast ...as the target type of a cast operation.
[C++] catch parameter ...as the parameter type in a catch() expression
[C++] constant ... as a function parameter qualified as const.
[C++] constructor initialization ... as the type of a base class constructor in an initialization list
[C++] definition ...when defined (in the template definition/declaration).
[C++] formal ...as the type of a formal parameter in a function definition or declaration.
[C++] friend ...declared as a friend.
[C++] global ...as the type of a global variable.
[C++] local ...as the type of a local variable.
[C++] local static ...as the type of a local static variable.
[C++] member ...as the type of a data member in an aggregate structure.
[C++] new ...in the type of a new expression
[C++] qualifier ...in the first operand of a name qualifier expression TT::x.
[C++] return type ...as the return type in a function definition or declaration.
[C++] sizeof ...as the argument to sizeof().
[C++] subclass ...as the superclass in a subclass declaration.
[C++] template argument ...as a type argument for template instantiation.
[C++] template parameter ...as the type of a template value parameter.
[C++] throw exception specifier ..as the parameter type in a throw() expression
[C++] typedef ...in the first operand of a typedef statement.
[C++] other ...otherwise.

template value

Name of a value parameter Tv for a template. [examples]
[C++] definition ...when defined (in the template definition/declaration).
[C++] invocation ...when invoked (for function pointers)
[C++] method invocation ...when one of its methods is invoked (for aggregates).
[C++] read ...when its value is read.
[C++] sizeof ...as the argument to sizeof().
[C++] take address ...as the operand of an addressing expression &Tv.
[C++] template argument ...as a value argument for template instantiation.
[C++] write ...when it is written to.
[C++] write through ...when it is dereferenced and its target written to (for pointers)
[C++] other  ...otherwise.

tag

Type tag t. [examples]
C only: type tags in code compiled as C++ have kind type.
[C] cast ...as the target type of a cast operation.
[C] declaration ...when declared.
[C] definition ...when defined.
[C] file static ...as the type of a file static variable.
[C] formal ...as the type of a formal parameter in a function definition or declaration.
[C] global ...as the type of a global variable.
[C] local ...as the type of a local variable.
[C] local static ...as the type of a local static variable.
[C] member ...as the type of a member of an aggregate.
[C] return type ...as the return type in a function definition or declaration.
[C] sizeof ...as the argument to sizeof().
[C] typedef ...in the first operand of a typedef statement.

type

Type name T. [examples]
cast ...as the target type of a cast operation.
definition ...when defined.
file static ...as the type of a file static variable.
formal ...as the type of a formal parameter in a function definition or declaration.
global ...as the type of a global variable.
local ...as the type of a local variable.
local static ...as the type of a local static variable.
member ...as the type of a member of an aggregate.
return type ...as the return type in a function definition or declaration.
sizeof ...as the argument to sizeof().
tag ...in the second operand of a typedef statement where the first operand is an enum, struct, or union whose tag is exactly the same as the type name.
typedef ...in the first operand of a typedef statement.
[C++] catch parameter ...as the parameter type in a catch() expression.
[C++] constant ...as the type of a variable declared as const.
[C++] constructor initialization ...as the type of a base class constructor in an initialization list.
[C++] declaration ...when declared.
[C++] friend ...declared as a friend.
[C++] new ...in the type of a new expression.
[C++] qualifier ...in the first operand of a name qualifier expression T::x.
[C++] subclass ...as the superclass in a subclass declaration.
[C++] template argument ...as a type argument for template instantiation.
[C++] template parameter ...as the type of a template value parameter.
[C++] throw exception specifier ...as the parameter type in a throw() expression.
other ...otherwise.

Kind-Usage Examples

Code examples illustrating the available kind-usage pairs are provided below.

type

cast * i = (INT) (2*sizeof(INT2));
definition * typedef int INT;
file static * static INT fsI;
formal * INT2 use_type_c(INT x)
global * INT globalI;
local * INT i;
local static * static INT lsI;
member * typedef struct mystruct{INT i;} mystruct;
return type * INT2 use_type_c(INT x)
sizeof * sizeof(INT2)
tag * typedef struct mystruct{INT i;} mystruct;
typedef * typedef INT INT2;
[C++] catch parameter * catch (INTB b)
[C++] constant * const INTA a=5;
[C++] constructor initialization * Zderived(): X()
[C++] declaration * template <typename T, INTA size> struct Vector {};
[C++] friend * friend struct Vector<INTB,10>;
[C++] new * myx = new X();
[C++] qualifier * int Zderived::*pm;
[C++] subclass * struct Zderived: X
[C++] template argument * Vector<INTB, 10>
[C++] template parameter * template <typename T, INTA size>
[C++] throw exception specifier * void use_type_cpp(void) throw (INTA)
other   -
/* C */
/* T_001 */  typedef int INT;
/* T_002 */  typedef INT INT2;
/* T_003 */  
/* T_004 */  typedef struct mystruct{INT i;} mystruct;
/* T_005 */  
/* T_006 */  INT globalI;
/* T_007 */  static INT fsI;
/* T_008 */  
/* T_009 */  INT2 use_type_c(INT x){
/* T_010 */      INT i;
/* T_011 */      static INT lsI;
/* T_012 */      i = (INT) (2*sizeof(INT2));
/* T_013 */      return i;
/* T_014 */  }
/* C++ */
/* T_101 */  typedef int INTA;
/* T_102 */  typedef int INTB;
/* T_103 */
/* T_104 */  template <typename T, INTA size> struct Vector {};
/* T_105 */
/* T_106 */  struct X { friend struct Vector<INTB, 10>;};
/* T_107 */    
/* T_108 */  struct Zderived : X {
/* T_109 */      Zderived() : X(){}
/* T_110 */      int x;
/* T_111 */  };
/* T_112 */    
/* T_113 */  int Zderived::*pm;
/* T_114 */  const INTA a = 5;
/* T_115 */
/* T_116 */  void use_type_cpp(void) throw (INTA){
/* T_117 */      try {
/* T_118 */           X *myx;
/* T_119 */           myx = new X();
/* T_120 */      }
/* T_121 */      catch (INTB b) {}
/* T_122 */  }

global variable

declaration * extern int global_var;
definition * int global_var = 7;
invocation * fptr(sizeof(global_var));
read * *ptri = global_var;
sizeof * fptr(sizeof(global_var));
take address * ptri = &global_var;
write * ptri = &global_var;
write through * *ptri = global_var;
[C++] method invocation * p.f();
[C++] template argument * PI<&b> p;
other -
/* C */
/* GV_001 */  extern int global_var;
/* GV_002 */  int global_var = 7;
/* GV_003 */  void f(int i){};
/* GV_004 */  void (*fptr)(int) = &f;
/* GV_005 */  int *ptri;
/* GV_006 */  
/* GV_007 */  void use_var_global_c(void){   
/* GV_008 */      ptri = &global_var;
/* GV_009 */      *ptri = global_var;
/* GV_010 */      fptr(sizeof(global_var));
/* GV_011 */  }
/* C++ */
/* GV_101 */  template <int *i> struct PI{void f(void);};
/* GV_102 */  int b;
/* GV_103 */  PI<&b> p;
/* GV_104 */ 
/* GV_105 */  void use_var_global_cpp(void){ p.f();}

local variable

declaration * void use_var_local_c(x)
definition * int *ptri; {
invocation * fptr(sizeof(y));
read * *ptri = y;
sizeof * fptr(sizeof(y));
take address * ptri = &y;
write * ptri = &y;
write through * *ptri = y;
[C++] method invocation * p.f();
[C++] template argument * TI<b> p;
other -
/* C */
/* LV_001 */  typedef void (*FTYPE)(int);
/* LV_002 */
/* LV_003 */  void use_var_local_c(x)   /* K&R-style function definition */
/* LV_004 */    int x; {
/* LV_005 */      int *ptri;
/* LV_006 */      int y=x;
/* LV_007 */      void f(int i){};
/* LV_008 */      FTYPE fptr = &f;
/* LV_009 */     
/* LV_010 */      ptri = &y;
/* LV_011 */      *ptri = y;
/* LV_012 */      fptr(sizeof(y));
/* LV_013 */  }
/* C++ */
/* LV_101 */  template <int i> struct TI{void f(void);};
/* LV_102 */  void use_var_local_cpp(void){
/* LV_103 */      const int b=5;
/* LV_104 */      TI<b> p;
/* LV_105 */      p.f();
/* LV_106 */  }

local static variable

definition * static int x = 5;
invocation * fptr(sizeof(x));
read * *ptri = x;
sizeof * fptr(sizeof(x));
take address * ptri = &x;
write * ptri = &x;
write through * *ptri = x;
[C++] method invocation * p.f();
[C++] template argument * TI<b> p;
other -
/* C */
/* LSV_001 */  typedef void (*FTYPE)(int);
/* LSV_002 */  void f(int i){};
/* LSV_003 */
/* LSV_004 */  void use_var_local_static_c(void){ 
/* LSV_005 */      static int x = 5;
/* LSV_006 */      static int *ptri;
/* LSV_007 */      static FTYPE fptr = &f;
/* LSV_008 */     
/* LSV_009 */      ptri = &x;
/* LSV_010 */      *ptri = x;
/* LSV_011 */      fptr(sizeof(x));
/* LSV_012 */  }
/* C++ */
/* LSV_101 */  template <int i> struct TI{void f(void);};
/* LSV_102 */  void use_var_local_static_cpp(void){
/* LSV_103 */      static const int b=5;
/* LSV_104 */      static TI<b> p;
/* LSV_105 */      p.f();
/* LSV_106 */  }

file static variable

declaration * extern int x;
definition * static int x;
invocation * fptr(sizeof(x));
read * *ptri = x;
sizeof * fptr(sizeof(x));
take address * ptri = &x;
write * ptri = &x;
write through * *ptri = x;
[C++] method invocation * p.f();
[C++] template argument * PI<&b> p;
other -
/* C */
/* SV_001 */  typedef void (*FTYPE)(int);
/* SV_002 */  void f(int i){};
/* SV_003 */  static int x;
/* SV_004 */  extern int x;
/* SV_005 */  static int *ptri;
/* SV_006 */  static FTYPE fptr = &f;
/* SV_007 */     
/* SV_008 */  void use_var_static_c(void){    
/* SV_009 */     ptri = &x;
/* SV_010 */     *ptri = x;
/* SV_011 */     fptr(sizeof(x));
/* SV_012 */  }
/* C++ */
/* SV_101 */  template <int *i> struct PI{void f(void);};
/* SV_102 */  static int b;
/* SV_103 */  static PI<&b> p; /* C++11 or later */
/* SV_104 */ 
/* SV_105 */  void use_var_static_cpp(void){ p.f();}

parameter

declaration * void use_var_local_c( int *x, int y, FTYPE fptr);
definition * void use_var_local_c( int *x, int y, FTYPE fptr){
invocation * fptr(sizeof(y));
read * *x = y;
sizeof * fptr(sizeof(y));
take address * x = &y;
write * x = &y;
write through * *x = y;
[C++] method invocation * p.f();
other -
/* C */
/* PV_001 */  typedef void (*FTYPE)(int);
/* PV_002 */  void use_var_parameter_c( int *x, int y, FTYPE fptr);
/* PV_003 */           
/* PV_004 */  void use_var_parameter_c( int *x, int y, FTYPE fptr)   { 
/* PV_005 */     x = &y;
/* PV_006 */      *x = y;
/* PV_007 */     fptr(sizeof(y)); 
/* PV_008 */  }
/* C++ */

macro

definition * #define MYDEF 5
invocation * int k = MYDEF;
redefinition * #define BADREDEF 6
undefinition * #undef MYDEF
/* M_01 */  #define MYDEF 5
/* M_02 */  #undef MYDEF
/* M_03 */  #define MYDEF 6
/* M_04 */  
/* M_05 */  #define BADREDEF 5
/* M_06 */  #define BADREDEF 6
/* M_07 */  
/* M_08 */  int k = MYDEF;
 

function

call * int i = ifunc();
declaration * int ifunc(void);
definition * int ifunc(void){return 5;};
sizeof * size_t s = sizeof(ifunc());
take address * int(*fptr)(void) = &ifunc;
[C++] friend * friend int myfunc (int);
[C++] template argument * PF<&myfunc> p;
other -
/* C */
/* FN_001 */  int ifunc (void);
/* FN_002 */  int ifunc (void){return 5;}
/* FN_003 */  int(*fptr)(void) = &ifunc;
/* FN_004 */
/* FN_005 */  void use_function_c(void){
/* FN_006 */      int i = ifunc();
/* FN_007 */      size_t s = sizeof(ifunc());
/* FN_008 */  }
/* C++ */
/* FN_101 */  int myfunc(int);
/* FN_102 */  
/* FN_103 */  template <int (*f)(int)> struct PF{};
/* FN_104 */  
/* FN_105 */  struct X {friend int myfunc(int);};
/* FN_106 */  
/* FN_107 */  PF<&myfunc> p;

static function

call * int i = ifunc();
declaration * static int ifunc(void);
definition * static int ifunc(void){return 5;};
sizeof * size_t s = sizeof(ifunc());
take address * int(*fptr)(void) = &ifunc;
[C++] friend * friend int myfunc (int);
[C++] template argument * PF<&myfunc> p;
other -
/* C */
/* SFN_001 */  static int ifunc (void);
/* SFN_002 */  static int ifunc (void){return 5;}
/* SFN_003 */  int(*fptr)(void) = &ifunc;
/* SFN_004 */
/* SFN_005 */  void use_func_static_c(void){
/* SFN_006 */      int i = ifunc();
/* SFN_007 */      size_t s = sizeof(ifunc());
/* SFN_008 */  }
/* C++ */
/* SFN_101 */  static int myfunc(int);
/* SFN_102 */  typedef int (*FTYPE)(int);
/* SFN_103 */  
/* SFN_104 */  template <FTYPE f> struct PF{};
/* SFN_105 */  
/* SFN_106 */  struct X {friend int myfunc(int);};
/* SFN_107 */  
/* SFN_108 */  PF<&myfunc> p;  /* C++11 or later */  

method

[C++] call * int i = C.methA();
[C++] declaration * int methA(void);
[C++] definition * int MyClass::methA(void){return 5;};
[C++] friend * friend int MyClass::methA(void);
[C++] sizeof * size_t s = sizeof(C.methA());
[C++] take address * MyClass(){ fptr = &MyClass::methA;}
[C++] template argument * PF<&MyClass::methA> p;
[C++] other -
/* C++ */
/* M_101 */ class MyClass;
/* M_102 */ typedef int (MyClass::*FTYPE)(void);
/* M_103 */ template <FTYPE f> struct PF{};
/* M_104 */ 
/* M_105 */ class MyClass{
/* M_106 */   public:
/* M_107 */     int methA (void);
/* M_108 */     FTYPE fptr;
/* M_109 */     PF<&MyClass::methA> p;
/* M_110 */     MyClass(){fptr = &MyClass::methA;}
/* M_111 */ };
/* M_112 */ 
/* M_113 */ class FriendlyClass{
/* M_114 */     friend int MyClass::methA(void);
/* M_115 */ };
/* M_116 */ 
/* M_117 */ int MyClass::methA(void){return 5;}
/* M_118 */ 
/* M_119 */ void use_method_cpp(void){
/* M_120 */     MyClass C;
/* M_121 */     int i = C.methA();
/* M_122 */     size_t s = sizeof(C.methA());
/* M_123 */ }

static method

[C++] call * int i = C.methA();
[C++] declaration * static int methA(void);
[C++] definition * int MyClass::methA(void){return 5;};
[C++] friend * friend int MyClass::methA(void);
[C++] sizeof * size_t s = sizeof(C.methA());
[C++] take address * MyClass(){ fptr = &methA;}
[C++] template argument * PF<&methA> p;
[C++] other -
/* C++ */
/* SM_101 */ typedef int (*FTYPE)(void);
/* SM_102 */ template <FTYPE f> struct PF{};
/* SM_103 */ 
/* SM_104 */ class MyClass{
/* SM_105 */   public:
/* SM_106 */     static int methA(void);
/* SM_107 */     FTYPE fptr;
/* SM_108 */     PF<&methA> p;
/* SM_109 */     MyClass(){fptr = &methA;}
/* SM_110 */ };
/* SM_111 */
/* SM_112 */ class FriendlyClass{
/* SM_113 */     friend int MyClass::methA(void);
/* SM_114 */ };
/* SM_115 */ 
/* SM_116 */ int MyClass::methA(void){return 5;}
/* SM_117 */ 
/* SM_118 */ void use_method_static_cpp(void){
/* SM_119 */     MyClass C;
/* SM_120 */     int i = C.methA();
/* SM_121 */     size_t s = sizeof(C.methA());
/* SM_122 */ }

enum

definition * enum {red, blue, green} colors;
occurrence * int c = red;
/* E_01 */ enum {red, blue, green} colors;
/* E_02 */ int c = red;

string literal

  definition * char *str = "Hello, world";
/* SL_01 */ char *str = "Hello, world";

template type

[C++] cast * lf = (F)se;
[C++] catch parameter * catch (E e);
[C++] constant * void trytemp (const E e) throw(F)
[C++] constructor initialization * CS() : C(){};
[C++] definition * template <typename T>
[C++] formal * void set(T t)
[C++] friend * friend C;
[C++] global * extern E * globalE;
[C++] local * T rv = value;
[C++] local static * static E se = e;
[C++] member * T value;
[C++] new * le = new E;
[C++] qualifier * int C::*pm;
[C++] return type * T& get()
[C++] sizeof * int i = sizeof(E);
[C++] subclass * class CS: public C
[C++] template argument * Item<T> s;
[C++] template parameter * template <typename T, T prim>
[C++] throw exception specifier * void trytemp (const E e) throw(F)
[C++] typedef * typedef T myT;
[C++] other   -
/* C++ */
/* TT_01 */  template <typename T> struct Item {
/* TT_02 */      T value;
/* TT_03 */      T get(){
/* TT_04 */          T rv = value; return rv;};
/* TT_05 */      void set(T t){value=t;};
/* TT_06 */  };
/* TT_07 */  
/* TT_08 */  template <typename T, 
/* TT_09 */           T prim> 
/* TT_10 */    struct St{
/* TT_11 */      typedef T myT;
/* TT_12 */      Item<T> s; };
/* TT_13 */  
/* TT_14 */  template <class C> class PM {
/* TT_15 */    public:
/* TT_16 */      int C::*pm;};
/* TT_17 */      friend C;
/* TT_18 */      class CS: public C { 
/* TT_19 */       public:
/* TT_20 */         CS() : C(){};
/* TT_21 */     };  
/* TT_22 */      CS x;
/* TT_23 */  };
/* TT_24 */  class D{};
/* TT_25 */  PM<D> foo;
/* TT_26 */  
/* TT_27 */  template <typename E,typename F>
/* TT_28 */      void trytemp (const E e) throw(F){
/* TT_29 */        try {
/* TT_30 */          static E se = e; 
/* TT_31 */          E *le;
/* TT_32 */          extern E * globalE; 
/* TT_33 */          int i = sizeof(E);
/* TT_34 */          F lf;
/* TT_35 */          le = new E; 
/* TT_36 */          lf = (F)se;
/* TT_37 */      }
/* TT_38 */      catch (E e){}
/* TT_39 */  }
/* TT_40 */  
/* TT_41 */  void use_tt (void) {
/* TT_42 */      St<int,5>  st;
/* TT_43 */      Item<int>  i;
/* TT_44 */      int a = i.get();
/* TT_45 */      trytemp<int,int> (a);
/* TT_46 */   }
/* TT_47 */
/* TT_48 */ template<typename T> static T fs_var;  /* C++14 or later */

template value

[C++] definition * template <char * s> struct StrCont {};
[C++] invocation * t.method();
[C++] method invocation * x.method();
[C++] read * c = p[0];
[C++] sizeof * sz = sizeof(x);
[C++] take address * &p[0];
[C++] template argument * StrCont<p> sc;
[C++] write * t.sz = 0;
[C++] write through * *p = 123;
[C++] other   -
/* C++ */
/* TV_01 */  struct T { void method() const {}};
/* TV_02 */  
/* TV_03 */  template <char * s> struct StrCont {};
/* TV_04 */  
/* TV_05 */  template <char * p, T const & x>
/* TV_06 */  struct S
/* TV_07 */  {
/* TV_08 */      int sz;
/* TV_09 */      char c;
/* TV_10 */      StrCont<p> sc;
/* TV_11 */      S(){ 
/* TV_12 */          sz = sizeof(x); 
/* TV_13 */          c = p[0];
/* TV_14 */          *p = 123;
/* TV_15 */          &p[0];
/* TV_16 */          x.method();
/* TV_17 */      }
/* TV_18 */  };
/* TV_19 */  
/* TV_20 */  template <typename Ty> 
/* TV_21 */  void invokeme(Ty t){ t.method(); }
/* TV_22 */  
/* TV_23 */  template <typename Ty> 
/* TV_24 */  void zerome(Ty t){ t.sz=0; }
/* TV_25 */  
/* TV_26 */  char buf[12];
/* TV_27 */  T t;
/* TV_28 */
/* TV_29 */  void use_tv()
/* TV_30 */  {
/* TV_31 */    S<buf, t> s;
/* TV_32 */    invokeme(t);
/* TV_33 */    zerome(s);
/* TV_34 */  }

file

  definition c_file.c, by file c_file.c
  include * #include "c_file.h"
/* c_file.c */
/* FL_01 */  #include "c_file.h"

field

  definition * int i;
  invocation * A.fp();
  read * x = A.i + sizeof(A.fp);
  sizeof * x = A.i + sizeof(A.fp);
  take address * b = &A.i;
  write * A.i = 5;
  write through * *(A.intptr) = 6;
[C++] constructor initialization * T():i(5)
[C++] method invocation * t.s.mf();
  other -
/* C */
/* FLD_001 */  typedef struct mystruct {
/* FLD_002 */      int i;
/* FLD_003 */      int *intptr; 
/* FLD_004 */      void(*fp)(void);
/* FLD_005 */  } S;
/* FLD_006 */ 
/* FLD_007 */  void use_field_c(void){
/* FLD_008 */      S A;
/* FLD_009 */      int *b;
/* FLD_010 */      int x;
/* FLD_011 */      A.i = 5;
/* FLD_012 */      x = A.i + sizeof(A.fp);
/* FLD_013 */      b = &A.i;
/* FLD_014 */      *(A.intptr) = 6;
/* FLD_015 */      A.fp();
/* FLD_016 */  }
/* C++ */
/* FLD_101 */  struct  S { void mf(void){}; };
/* FLD_102 */  struct T {
/* FLD_103 */      T():i(5){};
/* FLD_104 */      S s; int i;
/* FLD_105 */  };
/* FLD_106 */  
/* FLD_107 */  void use_field_cpp(){
/* FLD_108 */     T t;
/* FLD_109 */     t.s.mf();
/* FLD_110 */  }

namespace

[C++] definition * namespace myns { int x; }
[C++] ext * namespace myns { int y; }
[C++] qualifier * using myns::x;
[C++] using * using namespace otherns;
/* C++ */
/* NS_01 */ namespace myns { int x; }
/* NS_02 */ namespace myns { int y; }
/* NS_03 */ namespace otherns { int z; }
/* NS_04 */ 
/* NS_05 */ void use_ns(void){
/* NS_06 */     using namespace otherns;
/* NS_07 */     using myns::x;
/* NS_08 */     int y = z + x;
/* NS_09 */ }

tag

[C] cast * e1 = (enum enumtag) 1;
[C] declaration * struct mystruct;
[C] definition * struct mystruct{enum enumtag i;};
[C] file-static * static struct mystruct staticS;
[C] formal * struct mystruct f(struct mystruct mparam){
[C] global * struct mystruct S;
[C] local * enum enumtag e1;
[C] local static * static enum enumtag e2;
[C] member * struct mystruct{enum enumtag i;};
[C] return type * struct mystruct f(struct mystruct mparam){
[C] sizeof * mparam.i = sizeof(struct mystruct);
[C] typedef * typedef struct mystruct T;
[C] other -
/* code compiled as C  only */
/* TAG_01 */ struct mystruct;
/* TAG_02 */ enum enumtag {sym1, sym2, sym3};
/* TAG_03 */ struct mystruct{enum enumtag i;};
/* TAG_04 */ struct mystruct S;
/* TAG_05 */ static struct mystruct staticS;
/* TAG_06 */ typedef struct mystruct T;
/* TAG_07 */ struct mystruct f(struct mystruct mparam){
/* TAG_08 */     enum enumtag e1;
/* TAG_09 */     static enum enumtag e2;
/* TAG_10 */     e1 = (enum enumtag) 1;
/* TAG_11 */     mparam.i = sizeof(struct mystruct);
/* TAG_12 */     return mparam;
/* TAG_13 */}
    
(Not used for code compiled as C++.)

label

definition * labelA: ptr = &&labelB;
goto * labelB: goto labelA;
take address * labelA: ptr = &&labelB;
/* L_01 */  void use_label(void)
/* L_02 */      void ** ptr;
/* L_03 */      labelA:  ptr = &&labelB;
/* L_04 */      labelB:  goto labelA;
/* L_05 */  }

builtin

 [C++/GNU C] other * __builtin_offsetof( struct S, i );
/* B_01 */  struct S { int i; };
/* B_02 */  
/* B_03 */  void test_builtin() {
/* B_04 */      __builtin_offsetof( struct S, i );
/* B_05 */  }