summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Provide an error when a non-identifier name (such as an operator) is used as aAlexis Hunt2010-11-031-1/+11
| | | | | | | | parameter name. Fixes PR8012. llvm-svn: 118138
* Eliminate an unused local variableDouglas Gregor2010-11-011-2/+0
| | | | llvm-svn: 117963
* Require that the types of the parameters of a block literal are complete.Douglas Gregor2010-11-011-7/+2
| | | | llvm-svn: 117942
* Avoid calculating linkage until the more obvious checks have run whenJohn McCall2010-10-271-15/+18
| | | | | | deciding whether to queue a decl for unused-declaration warnings. llvm-svn: 117431
* Parse attributes on enumerators and instantiate attributes on enum decls.John McCall2010-10-221-8/+10
| | | | llvm-svn: 117182
* Always treat 'main' as an extern "C" function, so that we detectDouglas Gregor2010-10-211-0/+5
| | | | | | | | | redeclarations of main appropriately rather than allowing it to be overloaded. Also, disallowing declaring main as a template. Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C. llvm-svn: 117029
* Pass TInfo to CXXDestructorDecl::Create(), just like we do for otherCraig Silverstein2010-10-211-3/+1
| | | | | | | | function decls. Reviewed by rjmccall and nlewycky. llvm-svn: 116979
* Redirect templated friend class decls to a new Sema callback andJohn McCall2010-10-191-8/+16
| | | | | | | construct an unsupported friend when there's a friend with a templated scope specifier. Fixes a consistency crash, rdar://problem/8540527 llvm-svn: 116786
* Implement the first half of [dcl.attr.override]p6.Anders Carlsson2010-10-181-0/+23
| | | | llvm-svn: 116709
* Microsoft enum extensions. 2 things will change on -fms-extensions:Francois Pichet2010-10-181-5/+11
| | | | | | | 1. enum underlying type is int by default. 2. Error "enumerator value is not representable in the underlying type"is a ExtWarning llvm-svn: 116704
* Implement [dcl.attr.override]p2 and add tests for p1 and p2.Anders Carlsson2010-10-171-1/+25
| | | | llvm-svn: 116692
* Reformatting.John McCall2010-10-161-2/+2
| | | | llvm-svn: 116662
* White-listing templated-scope friend decls is a good idea, but doing itJohn McCall2010-10-161-13/+19
| | | | | | | | by marking the decl invalid isn't. Make some steps towards supporting these and then hastily shut them down at the last second by marking them as unsupported. llvm-svn: 116661
* Allow list-initialization of a local variable of class type with aDouglas Gregor2010-10-151-3/+13
| | | | | | | | flexible array member, so long as the flexibility array member is either not initialized or is initialized with an empty initializer list. Fixes <rdar://problem/8540437>. llvm-svn: 116647
* Diagnose C++ [class.mem]p13-14, where a class member has the same nameDouglas Gregor2010-10-151-1/+29
| | | | | | as the class itself. Fixes PR7082. llvm-svn: 116573
* Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall2010-10-151-2/+2
| | | | | | ambiguous context. llvm-svn: 116567
* Don't complain about a variable within a linkage-specification that isDouglas Gregor2010-10-151-1/+1
| | | | | | initialized. Fixes PR7076. llvm-svn: 116553
* Don't add the injected class name to the redeclarations chain; the chain ↵Argyrios Kyrtzidis2010-10-141-1/+3
| | | | | | | | should contain actual redeclarations, not implicits. As a bonus, now we don't deserialize it unless we need it. llvm-svn: 116504
* Diagnose when a 'static' member function overrides a virtual functionDouglas Gregor2010-10-131-6/+24
| | | | | | in a base class. Fixes PR8168. llvm-svn: 116448
* Generalize the checking for qualification of (non-friend) classDouglas Gregor2010-10-131-17/+24
| | | | | | | | members. Provide a hard error when the qualification doesn't match the current class type, or a warning + Fix-it if it does match the current class type. Fixes PR8159. llvm-svn: 116445
* Support friend function declarations in local classes correctly.John McCall2010-10-131-45/+65
| | | | | | | | Fixes a crash and diagnoses the error condition of an unqualified friend which doesn't resolve to something. I'm still not certain how this is useful. llvm-svn: 116393
* Handle dependent friends more explicitly and deal with the possibilityJohn McCall2010-10-121-1/+3
| | | | | | | | of templated-scope friends by marking them invalid and white-listing all accesses until such time as we implement them. Fixes a crash, this time without a broken test case. llvm-svn: 116364
* Pacify gcc-4.4.Duncan Sands2010-10-121-2/+4
| | | | llvm-svn: 116300
* fix PR8217, a silent miscompilation of invalid code.Chris Lattner2010-10-101-5/+15
| | | | llvm-svn: 116166
* Fix g++.dg regressions introduced at r115347 (rdar://8529993)Argyrios Kyrtzidis2010-10-091-2/+2
| | | | llvm-svn: 116144
* Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor2010-10-081-18/+137
| | | | | | bit by me). llvm-svn: 116122
* Track the location of the context requiring an implicit conversion and use itJohn McCall2010-10-081-0/+3
| | | | | | to white-list conversions required by system headers. rdar://problem/8232669 llvm-svn: 116029
* Implement -fshort-enums (rdar://8490496).Argyrios Kyrtzidis2010-10-081-0/+4
| | | | llvm-svn: 116020
* Register the __builtin_va_list_type node when we parse it, rather thanDouglas Gregor2010-10-051-14/+2
| | | | | | | | waiting until we think we need it: we didn't catch all of the places where we actually needed it, and we probably wouldn't ever. Fixes a C++ PCH crasher. llvm-svn: 115621
* Better diagnostic for superfluous scope specifier inside a class definition ↵Francois Pichet2010-10-011-42/+52
| | | | | | | | | | | for member functions. + Fixit. Example: class A { void A::foo(); //warning: extra qualification on member 'foo' }; llvm-svn: 115347
* Move the maintenance of CXXRecordDecl::DefinitionData's Abstract bitDouglas Gregor2010-09-291-1/+58
| | | | | | | | | | | completely into CXXRecordDecl, by adding a new completeDefinition() function. This required a little reshuffling of the final-overrider checking code, since the "abstract" calculation in the presence of abstract base classes needs to occur in CXXRecordDecl::completeDefinition() but we don't want to compute final overriders more than one in the common case. llvm-svn: 115007
* Reinstate r114925 and r114929, both steps towardDouglas Gregor2010-09-281-21/+1
| | | | | | <rdar://problem/8459981>. llvm-svn: 114984
* vla expressions used in __typeof__ must be evaluated.Fariborz Jahanian2010-09-281-0/+19
| | | | | | Fixes rdar://8476159. llvm-svn: 114982
* Centralize the management of CXXRecordDecl::DefinitionData's Empty bitDouglas Gregor2010-09-281-6/+1
| | | | | | | | | | | | in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>. This reinstates r114924, with one crucial bug fix: we were ignoring the implicit fields created by anonymous structs/unions when updating the bits in CXXRecordDecl, which means that a class/struct containing only an anonymous class/struct would be considered "empty". Hilarity follows. llvm-svn: 114980
* Reinstate r114921, which I've exonerated via a self-host build.Douglas Gregor2010-09-281-18/+0
| | | | | | | | Centralize the management of CXXRecordDecl::DefinitionData's Aggregate and PlainOldData bits in CXXRecordDecl itself. Another milepost on the road toward <rdar://problem/8459981>. llvm-svn: 114977
* Temporarily revert 114929 114925 114924 114921. It looked like they (or at leastBill Wendling2010-09-281-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | one of them) was causing a series of failures: http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518 svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114929 into '.': U include/clang/Sema/Sema.h U include/clang/AST/DeclCXX.h U lib/Sema/SemaDeclCXX.cpp U lib/Sema/SemaTemplateInstantiateDecl.cpp U lib/Sema/SemaDecl.cpp U lib/Sema/SemaTemplateInstantiate.cpp U lib/AST/DeclCXX.cpp svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114925 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/AST/DeclCXX.cpp svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114924 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/Sema/SemaDecl.cpp G lib/AST/DeclCXX.cpp U lib/AST/ASTContext.cpp svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114921 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/Sema/SemaDecl.cpp G lib/AST/DeclCXX.cpp llvm-svn: 114933
* Centralize the management of CXXRecordDecl::DefinitionData'sDouglas Gregor2010-09-281-21/+1
| | | | | | | | | | | HasTrivialConstructor, HasTrivialCopyConstructor, HasTrivialCopyAssignment, and HasTrivialDestructor bits in CXXRecordDecl's methods. This completes all but the Abstract bit and the set of conversion functions, both of which will require a bit of extra work. The majority of <rdar://problem/8459981> is now implemented (but not all of it). llvm-svn: 114929
* Centralize the management of CXXRecordDecl::DefinitionData's Empty bitDouglas Gregor2010-09-271-6/+1
| | | | | | in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>. llvm-svn: 114924
* Centralize the management of CXXRecordDecl::DefinitionData's AggregateDouglas Gregor2010-09-271-18/+0
| | | | | | | and PlainOldData bits in CXXRecordDecl itself. Another milepost on the road toward <rdar://problem/8459981>. llvm-svn: 114921
* Centralize the handling of CXXRecordDecl::DefinitionData'sDouglas Gregor2010-09-271-1/+0
| | | | | | | DeclaredDestructor and UserDeclaredDestructor bits in CXXRecordDecl itself. Another step on the road to <rdar://problem/8459981>. llvm-svn: 114918
* Kill FunctionDecl's IsCopyAssignment bit; it duplicated what couldDouglas Gregor2010-09-271-1/+2
| | | | | | | | already be determined by isCopyAssignmentOperator(), and was set too late in the process for all clients to see the appropriate value. Cleanup only; no functionality change. llvm-svn: 114916
* Centralize the handling ofDouglas Gregor2010-09-271-1/+3
| | | | | | | CXXRecordDecl::DefinitionData::DeclaredCopyAssignment, for copy-assignment operators. Another step toward <rdar://problem/8459981>. llvm-svn: 114899
* Fix bogus compiler errors when declaring anonymous union, outside a class, withArgyrios Kyrtzidis2010-09-231-5/+4
| | | | | | | members with the same name as a decl outside the scope where the members are actually introduced. Fixes http://llvm.org/PR6741 llvm-svn: 114641
* Implement -Wunused-label.Argyrios Kyrtzidis2010-09-191-1/+4
| | | | llvm-svn: 114315
* When dealing with an anonymous enumeration declared in functionDouglas Gregor2010-09-161-5/+9
| | | | | | | | | | | | | | prototype scope, temporarily set the context of the enumeration declaration to the translation unit. We do the same thing for parameters, until we have an actual function declaration on which to hang them. Fixes <rdar://problem/8435682>. There is more work to do in this area, since we have existing bugs with tags being declared/defined in function parameter lists. This fix is correct, and we'll end up extending it when we deal with those existing bugs. llvm-svn: 114135
* Microsoft's flexible array rules relaxation:Francois Pichet2010-09-151-4/+15
| | | | | | | - in union - as the only element of a struct/class. llvm-svn: 113909
* Add basic support for Microsoft enum forward declaration. Francois Pichet2010-09-121-3/+6
| | | | | | Assigning an underlying integral type to an enum forward declaration will come in a next patch. llvm-svn: 113716
* Support in-class initialization of static const floating-point data members.John McCall2010-09-101-25/+53
| | | | llvm-svn: 113663
* Allow type definitions inside anonymous struct/union in Microsoft mode.Francois Pichet2010-09-081-5/+19
| | | | llvm-svn: 113354
* add a fixit when 'main' does ot return 'int'; review welcomeGabor Greif2010-09-081-3/+9
| | | | llvm-svn: 113324
OpenPOWER on IntegriCloud