Opened 5 years ago

#120 new defect

dtype problem

Reported by: pabuhr Owned by:
Priority: major Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

For dtype, this:

forall( dtype T ) T * nullptr( void ) { return (T *)0; }
int * pi = nullptr();
int & ri = *nullptr();

generates:

CFA Version 1.0.0 (debug)
test1.cfa:39:1 error: No reasonable alternatives for expression Applying untyped:
  Name: *?
...to:
  Applying untyped:
    Name: nullptr
  ...to:

For otype, it generates:

cfa test1.cfa
CFA Version 1.0.0 (debug)
test1.cfa:39:33: error: '_tmp_cp_ret2' undeclared here (not in a function)
 int & ri = *nullptr();
                                 ^           
test1.cfa:39:179: error: '_adapterFv_Pii__MP' undeclared here (not in a function)
 int & ri = *nullptr();
                                                                                                                                                                                   ^                 
test1.cfa:39:199: error: '_adapterFi_Pii_P_MP' undeclared here (not in a function)
 int & ri = *nullptr();

Staying with otype and moving the declarations into a local scope:

forall( otype T ) T * nullptr( void ) { return (T *)0; }
int fred() {
    int * pi = nullptr();
    int & ri = *nullptr();
}

does compile.

It fails as above with dtype and declarations in a local scope.

Change History (0)

Note: See TracTickets for help on using tickets.