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

QStringLiteral fails in context where a variable 's' is already defined

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.4.0
    • Fix Version/s: 5.4.0
    • Labels:
      None
    • Environment:
      MSVC 2013 32 bit

      Description

      The internal use of 's' in the lambda definition of QStringLiteral can conflict with external variables:

          if (char *s = 0)
              return QStringLiteral("Error");
      
      
      main.cpp(7) : error C2373: 's' : redefinition; different type modifiers
              main.cpp(6) : see declaration of 's'
      main.cpp(7) : error C3493: 's' cannot be implicitly captured because no default capture mode has been specified
      

        Attachments

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

          Activity

            People

            Assignee:
            kkohne Kai Köhne
            Reporter:
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes