https://bugs.kde.org/show_bug.cgi?id=417903

            Bug ID: 417903
           Summary: Semantic analysis fails to recognize std::filesystem
                    namespace
           Product: kdevelop
           Version: 5.5.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Analyzer: Cppcheck
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: kogiokkaf...@gmail.com
  Target Milestone: ---

Created attachment 126186
  --> https://bugs.kde.org/attachment.cgi?id=126186&action=edit
Screenshots of semantic analysis error messages.

SUMMARY

Semantic analysis does not recognize std::filesystem even thought
CMAKE_CXX_STANDARD has been set as 17.

STEPS TO REPRODUCE

CMakeLists.txt
====================
cmake_minimum_required(VERSION 3.0)

project(bugreport)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

add_executable(bugreport main.cpp)

install(TARGETS bugreport RUNTIME DESTINATION bin)
====================

main.cpp
====================
#include <iostream>

#include <filesystem>
#include <chrono>

int main()
{
  using namespace std::filesystem;
  using namespace std::chrono;
  namespace fs = std::filesystem;
  namespace chr = std::chrono;
  std::filesystem::create_directories("sandbox");

  std::cout << "Hello, world!" << std::endl;
  return 0;
}
====================

OBSERVED RESULT

====================
Problem in Semantic analysis
Location: main.cpp :12
No member named 'filesystem' in namespace 'std'


Solution (1): Insert '#include <boost/filesystem.hpp>'
Solution (2): Insert '#include <experimental/filesystem>'
Solution (3): Insert '#include <filesystem>'
====================

====================
Problem in Semantic analysis
Expected namespace name
====================

EXPECTED RESULT

There should be no semantic analysis error.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.66.0
Qt Version: 5.13.2

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to