Skip to content

the decltype result is not complete #389

@netcan

Description

@netcan

input code:

#include <iostream>
struct Point {
  int x = 0;
  int y = 0;
};

int main() {
    Point pt;
    Point* pPt = &pt;
    const Point* cpPt = &pt;
    Point& lrPt = pt;
    Point&& rrPt = {};
    using T1 = decltype(pt); // Point
    using T2 = decltype(pPt); // Point*
    using T3 = decltype(cpPt); // const Point*
    using T4 = decltype(lrPt); // Point&
    using T5 = decltype(rrPt); // Point&&
}

result:

#include <iostream>
struct Point
{
  int x = 0;
  int y = 0;
  // inline constexpr Point() noexcept = default;
};




int main()
{
  Point pt = Point();
  Point * pPt = &pt;
  const Point * cpPt = &pt;
  Point & lrPt = pt;
  Point && rrPt = {{0}, {0}};
  using T1 = ;
  using T2 =  *;
  using T3 = const  *;
  using T4 =  &;
  using T5 =  &&;
}

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