Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75656

moc doesn't understand C++14 binary integer literals

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • None
    • 5.14.0
    • Build tools: moc
    • None

    Description

      The bug manifested for me exactly like #59351, so I'll steal its repro:

      namespace unit {
        int xx = 0b1010'0101;
      }
      int yy = 0b0101'1010;
      namespace xf {
        class HT16K33: public QObject {
           Q_OBJECT
        };
      }
      

      The lexer in moc parses octal/decimal/hex literals correctly, but doesn't recognize that `0b` introduces a binary integer literal. This is typically benign, except in combination with digit separators. Just as in #59351, the digit separators are treated as delimiting a multicharacter literal and chaos ensues.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            villevoutilainen_qt Ville Voutilainen
            caseycarter Casey Carter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes