Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-311

Undeclared identifier error in constexpr

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • Qt for MCUs 2.8
    • Host Tools
    • None

    Description

      Attached a modified camera example which useses a module qmlproject file which contains foo.h. The normal camera example uses the camerainterface.h.

      Both foo.h and camerainterface.h contain the following snippet:

      constexpr long double foo()
      {
          return M_PI;
      }
      

      While this compiles fine in camerainterface.h, it doesn't compile in foo.h with the following error:

      /home/gagi/work/customers/v-zug/qul_vanilla/examples/camera/foo.h:5:15: error: use of undeclared identifier 'M_PI'
      /home/gagi/work/customers/v-zug/qul_vanilla/examples/camera/foo.h:5:9: warning: uninitialized variable in a constexpr function is a C++20 extension [-Wc++20-extensions]
      Error: use of undeclared identifier 'M_PI'
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            gagi Dominik Holland
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes