Skip to content

typename(...) misconstrued as normal 'typename' keyword when used in base list #54

Description

@davrec72

Low priority problem with the typename(...) syntax:

struct A {};
struct B : A {};

//struct BCopy1 : typename(get<0>($B.bases()).type()) {};
//// ^ "error: 'typename' is redundant; base classes are implicitly types"

using B_base0 = typename(get<0>($B.bases()).type());
struct BCopy2 : B_base0 {};  //Works

The fix I suppose is that wherever Clang is throwing the "typename is redundant" error after a parse, it should now parse just beyond the typename to see if a left parens follows, and only throw the error if it doesn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions