Skip to content

[expr.typeid] glvalue of incomplete type vs typeid #4826

@xmh0511

Description

@xmh0511
struct C;
int storage;
C* ptr = (C*)&storage;
typeid(*ptr);  //#1

All compilers report #1 is an error, with the diagnosis invalid use of incomplete type. However, there's no relevant rule in the standard that restricts the type of the glvalue operand in [expr.typeid]. Is it an omission?

Metadata

Metadata

Assignees

Labels

cwgIssue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions