summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/anonymous-struct-union.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve the error message for assigning to read-only variables.Richard Trieu2015-04-111-3/+4
| | | | | | | | | | Previously, many error messages would simply be "read-only variable is not assignable" This change provides more information about why the variable is not assignable, as well as note to where the const is located. Differential Revision: http://reviews.llvm.org/D4479 llvm-svn: 234677
* Adding attributes to the IndirectFieldDecl that we generate for anonymous ↵Aaron Ballman2014-10-151-0/+10
| | | | | | struct/union fields. This fixes PR20930. llvm-svn: 219807
* revert patch r216469.Fariborz Jahanian2014-08-261-1/+1
| | | | llvm-svn: 216485
* c11- Check for c11 language option as documentation saysFariborz Jahanian2014-08-261-1/+1
| | | | | | | | feature is c11 about nested struct declarations must have struct-declarator-list. Without this change, code which was meant for c99 breaks. rdar://18125536 llvm-svn: 216469
* Sema: Handle declspecs without declarators in records properly in C modeDavid Majnemer2014-08-111-1/+1
| | | | | | | | | | | | | | | | | | | | | We had two bugs: - We wouldn't properly warn when a struct/union/enum was mentioned inside of a record definition if no declarator was provided. We should have mentioned that this declaration declares nothing. - We didn't properly support Microsoft's extension where certain declspecs without declarators would act as anonymous structs/unions. * We completely ignored the case where such a declspec could be a union. * We didn't properly handle the case where a record was defined inside another record: struct X { int a; struct Y { int b; }; }; llvm-svn: 215347
* Add missing diagnostic for a nested-name-specifier on a free-standing type ↵Richard Smith2013-03-181-1/+1
| | | | | | definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations. llvm-svn: 177335
* Fix a bug in semantic analysis involving anonymous structs and flexible arrays.Eli Friedman2012-02-071-0/+6
| | | | llvm-svn: 149966
* Fix tests to account for new warning "expected ';' at end of declaration ↵Carl Norum2011-03-071-1/+1
| | | | | | list". Sorry, folks! llvm-svn: 127188
* Improve diagnostics like "initializing <type> from an expression ofDouglas Gregor2010-04-091-1/+1
| | | | | | | type..." with "initializing <type> with an expression of type...", which reads better. Thanks to John for the improved wording. llvm-svn: 100873
* Improve diagnostics when we fail to convert from a source type to aDouglas Gregor2010-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | destination type for initialization, assignment, parameter-passing, etc. The main issue fixed here is that we used rather confusing wording for diagnostics such as t.c:2:9: warning: initializing 'char const [2]' discards qualifiers, expected 'char *' [-pedantic] char *name = __func__; ^ ~~~~~~~~ We're not initializing a 'char const [2]', we're initializing a 'char *' with an expression of type 'char const [2]'. Similar problems existed for other diagnostics in this area, so I've normalized them all with more precise descriptive text to say what we're initializing/converting/assigning/etc. from and to. The warning for the code above is now: t.c:2:9: warning: initializing 'char *' from an expression of type 'char const [2]' discards qualifiers [-pedantic] char *name = __func__; ^ ~~~~~~~~ Fixes <rdar://problem/7447179>. llvm-svn: 100832
* Downgrade the "declaration does not declare anything" error to aDouglas Gregor2010-04-081-5/+5
| | | | | | | warning. It's not harmful to have such pointless declarations, and GCC does not diagnose this issue consistently. llvm-svn: 100814
* Don't a.k.a. through the primary typedef of an anonymous tag decl.John McCall2010-01-131-0/+6
| | | | llvm-svn: 93362
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Clean up some error messages with anonymous structs/unions and member ↵Douglas Gregor2009-03-061-0/+7
| | | | | | declaration parsing. Fixes PR3680 llvm-svn: 66305
* Use the 'declaration does not declare anything' error when we see an ↵Douglas Gregor2009-03-061-3/+5
| | | | | | anonymous struct/union declaration outside of a struct or union in C llvm-svn: 66303
* Add coverage of "member of anonymous union redeclares ..." diagnostic.Daniel Dunbar2009-02-271-0/+8
| | | | llvm-svn: 65637
* fix rdar://6611778, a redefinition of an interface was causing anChris Lattner2009-02-231-2/+1
| | | | | | | | assertion when the ivars and method list was reset into the existing interface. To fix this, mark decls as invalid when they are redefined, and don't insert ivars/methods into invalid decls. llvm-svn: 65340
* Implement support for anonymous structs and unions in C. Both C andDouglas Gregor2009-01-121-0/+82
C++ handle anonymous structs/unions in the same way. Addresses several bugs: <rdar://problem/6259534> <rdar://problem/6481130> <rdar://problem/6483159> The test case in PR clang/1750 now passes with -fsyntax-only, but CodeGen for inline assembler still fails. llvm-svn: 62112
OpenPOWER on IntegriCloud