8000 Compiler bug with struct<struct<bit>> where struct is the same struct but using a typedef · Issue #3291 · p4lang/p4c · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Compiler bug with struct<struct<bit>> where struct is the same struct but using a typedef #3291
Closed
@apinski-cavium

Description

@apinski-cavium

Take:

struct h<t>{
  t f;
}

typedef h<bit> tt;
typedef h<tt> t;

This produces:

In file: /home/apinski/src/p4/p4c/ir/visitor.h:351
Compiler Bug: IR loop detected

If instead of the two typedefs you do:

typedef h<h<bit>> t1;

You get:

header.p4(5): [--Werror=type-error] error: h: recursive type specialization
typedef h<h<bit>> t1;
          ^

But I don't see how this is not allowed even with the approved section in the last language design meeting.

Metadata

Metadata

Assignees

Labels

fixedThis topic is 35D2 considered to be fixed.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0