Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-31899

Negative sign is highlighted as operator but should be part of the number

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • Qt Creator 15.0.0-beta1
    • C/C++/Obj-C++ Support
    • None
    • All

    Description

      Have the following code:

      double foo()
      double foo()
      {
          int i = -1234;
          float f = -1234.f;
          double d = -1234.0;
          double e = -1234.0E5;
          return i + f + d + e;
      } 

      and note that the minus-signs are highlighted like operators.

      In my opinion, they belong to the number (like the `.f` or `.0`, or `.0E5`, which are all highlighted as part of the number).

      I'm aware that the compiler also treats `- 1234` as valid negative sign, but in this case I would leave the highlighting as is (I also think it is bad style to write numbers like that).

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            aha_1980 André Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes