Bug 108667

Summary: compound literal initializers/assignments get marked as error
Product: [Applications] kdevelop Reporter: Gunther Piez <gpiez>
Component: Language Support: CPP (old)Assignee: kdevelop-bugs-null
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: 3.2.1   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description Gunther Piez 2005-07-06 22:14:46 UTC
Version:           3.2.1 (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
Compiler:          3.4.3 
OS:                Linux

Example from the gcc info page:

Assume that `struct foo' and `structure' are declared as shown: 

      struct foo {int a; char b[2];} structure;


Here is an example of constructing a `struct foo' with a compound
literal:

      structure = ((struct foo) {x + y, 'a', 0});

The second line gets marked as an error, it is perfectly valid. Note that this is not an obscure extension, it is part of the ISO 99 standard.
Comment 1 Gunther Piez 2005-07-06 22:17:01 UTC
Of course, the code compiles fine, it is only marked red in the editor.
Comment 2 Jens Dagerbo 2006-12-29 09:51:36 UTC
Problem is with the parser, not the Problems display widget.
Comment 3 Andreas Pakulat 2007-12-01 00:47:49 UTC
duplicate of the "parses C as C++" bug as far as I can see.

*** This bug has been marked as a duplicate of 57156 ***
Comment 4 Aleix Pol 2013-03-31 00:53:34 UTC
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively