Opened 7 years ago

Last modified 5 years ago

#10 assigned defect

Cannot declare anonymous union around generic type

Reported by: Thierry Delisle Owned by: mlbrooks
Priority: major Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description (last modified by mlbrooks)

Minimal example:

forall(otype T)
struct result {
    #ifdef THE_ERROR
    union {
    #endif

    T value;

    #ifdef THE_ERROR
    };
    #endif
};

produces :

error: ‘_sizeof_Y1T’ undeclared here (not in a function)

Desired for:

forall(otype T, otype E)
struct result {
	bool has_value;
	union {
		T value;
		E error;
	};
};

Change History (1)

comment:1 Changed 5 years ago by mlbrooks

Description: modified (diff)
Owner: changed from Rob Schluntz to mlbrooks
Summary: Inner generic types → Cannot declare anonymous union around generic type
Note: See TracTickets for help on using tickets.