Skip to content

[BUG] alias: type == _ generates invalid cpp1 #357

Closed
@realgdman

Description

@realgdman

Minimal reproduce
alias5: type == _;
passes succssfully cpp2, but generates invalid cpp1:
using alias5 = auto;

Command lines including which C++ compiler you are using
cppfront example.cpp2 -p
(build from latest mai. f83ca9b with clang++-15)
Then cpp1 compiled with
clang++-15 -Icppfront/include $1.cpp -std=c++20 -o $1

Actual result/error
Cppfront passes with
example.cpp2... ok (all Cpp2, passes safety checks)
But then clang fails with
error: 'auto' not allowed in type alias using alias5 = auto;

Expected result
Diagnostic at cpp2 side. (I guess that`s strategy, to catch whatever possible cpp2 relateed before relying on cpp1 compiler?)

Additional context
This is extreme case, because clang says auto is never allowed.
There is other case
alias6: type == foo when foo is not defined generates correct
using alias6 = foo;
But I guess this can be separate issue, for should cppfront check if alias goes to something undefined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions