Bug 283203

Summary: complains about static object declaration right after "struct"
Product: [Applications] kdevelop Reporter: Alexander Potashev <aspotashev>
Component: Language Support: CPP (old)Assignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: cponnapalli
Priority: NOR    
Version First Reported In: 4.2.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.0.0
Sentry Crash Report:
Attachments: kdevelop correctly compiles for the static object declaration after struct

Description Alexander Potashev 2011-10-02 20:04:08 UTC
Version:           4.2.3 (using KDE 4.7.1) 
OS:                Linux

When I write the following code:
    struct globalArgs_t
    {
        const char *branch;

        int numInputFiles;
        char **inputFiles;
    } static globalArgs;

KDevelop reports a syntax analysis problem: "Expected token ';' after '}' found 'static'".

Reproducible: Always



Expected Results:  
 

OS: Linux (x86_64) release 3.0-ARCH
Compiler: gcc
Comment 1 chaitanya srinivas ponnapalli 2016-04-30 06:10:11 UTC
Created attachment 98694 [details]
kdevelop correctly compiles for the static object declaration after struct

Reproduced the code given of the struct.
kdevelop correctly compiles without any errors or warnings when a static object declaration is made for the struct.
Attached the screenshot of the reproduced code along with the output.
Comment 2 Kevin Funk 2016-05-01 09:01:01 UTC
@Chaitanya: Again, this is not about compilation of above program, but about KDevelop's internal C++ support. "kdevelop correctly compiles" is a false statement as well, it's your compiler who's responsible for compiling the program. KDevelop is not a compiler.

Checked this issue under KDevelop 5: The new Clang backend reports no problems in above code example. Fixed.