https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92105

            Bug ID: 92105
           Summary: [7/8/9/10 Regression] decltype(decltype(decltype))
                    prints exponential number of fix-it hints
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

decltype(decltype) x = 42;

prints:

dt.cc:1:10: error: expected primary-expression before 'decltype'
    1 | decltype(decltype) x = 42;
      |          ^~~~~~~~
dt.cc:1:10: error: expected ')' before 'decltype'
    1 | decltype(decltype) x = 42;
      |         ~^~~~~~~~
      |          )
dt.cc:1:10: error: expected primary-expression before 'decltype'
    1 | decltype(decltype) x = 42;
      |          ^~~~~~~~
dt.cc:1:10: error: expected primary-expression before 'decltype'
dt.cc:1:10: error: expected primary-expression before 'decltype'
dt.cc:1:10: error: expected primary-expression before 'decltype'
dt.cc:1:1: error: expected unqualified-id before 'decltype'
    1 | decltype(decltype) x = 42;
      | ^~~~~~~~


but with an extra (decltype) it prints:

dt.cc:1:19: error: expected primary-expression before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      |                   ^~~~~~~~
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:10: error: expected primary-expression before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      |          ^~~~~~~~
dt.cc:1:10: error: expected ')' before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      |         ~^~~~~~~~
      |          )
dt.cc:1:19: error: expected primary-expression before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      |                   ^~~~~~~~
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:10: error: expected primary-expression before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      |          ^~~~~~~~
dt.cc:1:19: error: expected primary-expression before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      |                   ^~~~~~~~
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:10: error: expected primary-expression before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      |          ^~~~~~~~
dt.cc:1:19: error: expected primary-expression before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      |                   ^~~~~~~~
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:10: error: expected primary-expression before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      |          ^~~~~~~~
dt.cc:1:19: error: expected primary-expression before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      |                   ^~~~~~~~
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:19: error: expected primary-expression before 'decltype'
dt.cc:1:10: error: expected primary-expression before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      |          ^~~~~~~~
dt.cc:1:1: error: expected unqualified-id before 'decltype'
    1 | decltype(decltype(decltype)) x = 42;
      | ^~~~~~~~


Add another (decltype) and you get 272 lines. Another gives 1342, then 6722,
and so on to 4 millions lines for:

decltype(decltype(decltype(decltype(decltype(decltype(decltype(decltype(decltype(decltype)))))))))
x = 42;

Reply via email to