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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.0
    • 5.4.0
    • None
    • 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

        For Gerrit Dashboard: QTBUG-41706
        # Subject Branch Project Status CR V

        Activity

          People

            kkohne Kai Köhne
            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