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

Fix corelib/{text,time}/*_data_p.h static constexpr table anti-pattern

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P2: Important
    • 6.8.2, 6.9.0 FF
    • None
    • Core: Date/Time
    • None
    • 13
    • 0988042c4 (dev), 8189baf26 (6.8), 2fa59f025 (dev), e17d336a2 (6.8), 322e0ad32 (6.7), 96c07655c (dev), 58ddd0ac3 (dev), d802d268d (6.8), 5c1f32a3b (tqtc/lts-6.5), 5079925f2 (tqtc/lts-6.2), ce5df62c8 (6.7), fd7fb0bb4 (tqtc/lts-6.5), 86a90ec07 (tqtc/lts-6.2)
    • Foundation Sprint 116, Foundation Sprint 117, Foundation Sprint 118, Foundation Sprint 119

    Description

      Clang warns (correctly):

      corelib/time/qjalalicalendar_data_p.h:39:34: error: unused variable 'locale_data' [-Werror,-Wunused-const-variable]
      
        static constexpr QCalendarLocale locale_data[] = {
      
                                         ^
      
      corelib/time/qjalalicalendar_data_p.h:717:27:
        error: unused variable 'months_data' [-Werror,-Wunused-const-variable]
      
        static constexpr char16_t months_data[] = {
      

      (etc)

      Header files (*.h) are supposed to be robust against being included in multiple TUs, but these headers will re-define their constexpr tables in each TU they're included in, duplicating them every time.

      Suggest to rename to .cpp and include from other .cpp's.

      Attachments

        Issue Links

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

          Activity

            People

              Eddy Edward Welbourne
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes