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

c++ code model parsing shows error in macro using inline __pragma from MSVC

    XMLWordPrintable

Details

    Description

      when i have a macro whose definition contain __pragma to disable a warning inline the macro code, qt creator shows me an error in the next line saying
      "expected token ; got __pragma

      example macro:

      #define TRACE_WRITE(_engine_, _severitymask_, _message_) \
          do \
          { \
      __pragma(warning(push)) __pragma(warning(disable:4127))\
              const Tracing::TraceEngine& engine_used_for_trace_write = _engine_; \
              if (CHECK_TRACE_SEVERITY(engine_used_for_trace_write, (_severitymask_))) \
                  TRACE_WRITE_UNCHECKED(engine_used_for_trace_write, (_severitymask_), (_message_)); \
          } while(false) \
      __pragma(warning(pop))
      

      msvc would create a warning because of while(false) , so __para is used to supress it.

      Attachments

        Issue Links

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

          Activity

            People

              kosjar Nikolai Kosjar
              gunnar.roth Gunnar Roth
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes