Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-10220

Compiler mistakenly includes user header file instead of system one

    XMLWordPrintable

Details

    • Bug
    • Status: On Hold
    • Not Prioritized
    • Resolution: Unresolved

    Description

      The attached test case has a file named try1.cpp with these lines ...

      #include <regex>
      int a;
      

      It also has a sub-directory named subdir that contains a file named mutex.hpp with this line ...

      #warn This is not expected
      

      Build it ...

      % armcl -Isubdir try1.cpp
      "subdir\mutex.hpp", line 1: warning: #warning directive: This is not expected
      "C:\ti\compilers\ti-cgt-arm_20.2.4.LTS\include\libcxx\__locale", line 166: error: identifier "once_flag" is undefined
      "C:\ti\compilers\ti-cgt-arm_20.2.4.LTS\include\libcxx\__locale", line 171: error: constexpr "std::__2::locale::id::id()" provides no initializer for:
                  member "std::__2::locale::id::__flag_"
      2 errors detected in the compilation of "try1.cpp".
      
      >> Compilation failure
      

      The system header file <regex> includes <mutex>. But the user header file "mutex.hpp" is included instead. <mutex> defines the structure once_flag, and <__locale> refers to it. Because once_flag is not defined, the error diagnostics occur.

      Attachments

        Activity

          People

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: