Bug 283203 - complains about static object declaration right after "struct"
Summary: complains about static object declaration right after "struct"
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (other bugs)
Version First Reported In: 4.2.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-02 20:04 UTC by Alexander Potashev
Modified: 2016-12-13 08:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.0.0
Sentry Crash Report:


Attachments
kdevelop correctly compiles for the static object declaration after struct (185.22 KB, image/png)
2016-04-30 06:10 UTC, chaitanya srinivas ponnapalli
Details

Note You need to log in before you can comment on or make changes to this bug.
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.