Bug 473988

Summary: C++ Namespace Alias is not recognized by diagnostics tool, flags all mentions as errors.
Product: [Applications] kate Reporter: Njal <info>
Component: scriptingAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: minor CC: info, waqar.17a
Priority: NOR    
Version First Reported In: 23.08.0   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Njal 2023-08-31 12:47:00 UTC
SUMMARY
***
C++ Namespace Alias is not recognized by diagnostics tool, flags all mentions as errors.
***


STEPS TO REPRODUCE
1. Copy code:
#include <filesystem>
namespace fs = std::filesystem;
using namespace std;
int main(){ fs::path somepath; somepath = "./somepath" }

OBSERVED RESULT
Diagnostic tool marks namespace alias as "expected namespace name", and all following mentions of the alias as "use of undeclared identifier".

EXPECTED RESULT
The diagnostic tool recognizing the namespace alias,  and replacing it with the namespace internally for the rest fo the code.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
Linux Manjaro
KDE Plasma Version: 
5.27.7
KDE Frameworks Version: 
5.109.0
Qt Version: 
5.15.10

ADDITIONAL INFORMATION
Comment 1 Njal 2023-08-31 12:55:26 UTC
Also, when using std::filesystem instead of fs in the code, clang reports "No member named 'filesystem' in namespace 'std'".
Comment 2 Waqar Ahmed 2023-08-31 13:24:30 UTC
Thid is not a bug, you need to set up clangd properly for your project. Its easy if you are using cmake or meson. Please visit https://clangd.llvm.org/installation#project-setup to learn how to setup your project
Comment 3 Njal 2023-08-31 16:32:33 UTC
(In reply to Waqar Ahmed from comment #2)

Oh okay, thanks for the link, and sorry for troubling you. I honestly did not find anything googling the issue, i hope this report will serve that function now :)