summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/incomplete-decl.c
Commit message (Collapse)AuthorAgeFilesLines
* Factor out (some of) the checking for invalid forms of pointerChandler Carruth2011-06-271-1/+1
| | | | | | | | | | | | | | | | | | | arithmetic into a couple of common routines. Use these to make the messages more consistent in the various contexts, especially in terms of consistently diagnosing binary operators with invalid types on both the left- and right-hand side. Also, improve the grammar and wording of the messages some, handling both two pointers and two (different) types. The wording of function pointer arithmetic diagnostics still strikes me as poorly phrased, and I worry this makes them slightly more awkward if more consistent. I'm hoping to fix that with a follow-on patch and test case that will also make them more helpful when a typedef or template type parameter makes the type completely opaque. Suggestions on better wording are very welcome, thanks to Richard Smith for some initial help on that front. llvm-svn: 133906
* Migrate the mish-mash of declaration checks inDouglas Gregor2010-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sema::ActOnUninitializedDecl over to InitializationSequence (with default initialization), eliminating redundancy. More importantly, we now check that a const definition in C++ has an initilizer, which was an #if 0'd code for many, many months. A few other tweaks were needed to get everything working again: - Fix all of the places in the testsuite where we defined const objects without initializers (now that we diagnose this issue) - Teach instantiation of static data members to find the previous declaration, so that we build proper redeclaration chains. Previously, we had the redeclaration chain but built it too late to be useful, because... - Teach instantiation of static data member definitions not to try to check an initializer if a previous declaration already had an initializer. This makes sure that we don't complain about static const data members with in-class initializers and out-of-line definitions. - Move all of the incomplete-type checking logic out of Sema::FinalizeDeclaratorGroup; it makes more sense in ActOnUnitializedDecl. There may still be a few places where we can improve these diagnostics. I'll address that as a separate commit. llvm-svn: 95657
* 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
* Improve GCC compatibility by allowing static tentative definitions ofDouglas Gregor2009-07-201-2/+3
| | | | | | incomplete type (with a warning), from Enea Zaffanella! llvm-svn: 76451
* Add warning when a tentative array definition is assumed to have one element.Daniel Dunbar2009-04-151-2/+2
| | | | | | - Also, fixed one to actually be one (instead of zero). :) llvm-svn: 69226
* PR3461: reject initializer for incomplete type. Based on patch by TimEli Friedman2009-04-131-0/+5
| | | | | | Northover. llvm-svn: 68991
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Add type checking for tentative definitions at the end of theDouglas Gregor2009-03-101-2/+2
| | | | | | | | | translation unit. Thread the various declarations of variables via VarDecl::getPreviousDeclaration. llvm-svn: 66601
* Partial fix for PR3310, concerning type-checking for tentativeDouglas Gregor2009-03-101-2/+2
| | | | | | | | | | | definitions. We were rejecting tentative definitions of incomplete (which is bad), and now we don't. This fix is partial because we don't do the end-of-translation-unit initialization for tentative definitions that don't ever have any initializers specified. llvm-svn: 66584
* Make one expected-diag directive match exactly one actual diagnostic.Sebastian Redl2009-02-071-1/+1
| | | | | | This uncovers some bugs, so several test cases now fail. llvm-svn: 64025
* Centralize error reporting of improper uses of incomplete types in theDouglas Gregor2009-01-191-0/+2
| | | | | | | | | | new DiagnoseIncompleteType. It provides additional information about struct/class/union/enum types when possible, either by pointing to the forward declaration of that type or by pointing to the definition (if we're in the process of defining that type). Fixes <rdar://problem/6500531>. llvm-svn: 62521
* new testcaseChris Lattner2008-07-031-0/+4
| | | | llvm-svn: 53071
* Sema::FinalizeDeclaratorGroup(): Tighten up the tentative definition rule ↵Steve Naroff2008-01-181-0/+4
| | | | | | | | when dealing with arrays. Bug submitted by Eli. llvm-svn: 46179
* Sema::FinalizeDeclaratorGroup()...make sure we emit an diagnostic for ↵Steve Naroff2008-01-181-0/+15
tentative definitions with incomplete types. Touch up all test cases that are effected. llvm-svn: 46152
OpenPOWER on IntegriCloud