summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Pull out r121752 in case it's causing the selfhost breakage.John McCall2010-12-141-7/+10
| | | | llvm-svn: 121759
* Factor out most of the extra state in a FunctionProtoType into a separateJohn McCall2010-12-141-10/+7
| | | | | | | class to be passed around. The line between argument and return types and everything else is kindof vague, but I think it's justifiable. llvm-svn: 121752
* Variadic templates: extend Type, NestedNameSpecifier, TemplateName,Douglas Gregor2010-12-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | and TemplateArgument with an operation that determines whether there are any unexpanded parameter packs within that construct. Use this information to diagnose the appearance of the names of parameter packs that have not been expanded (C++ [temp.variadic]p5). Since this property is checked often (every declaration, ever expression statement, etc.), we extend Type and Expr with a bit storing the result of this computation, rather than walking the AST each time to determine whether any unexpanded parameter packs occur. This commit is deficient in several ways, which will be remedied with future commits: - Expr has a bit to store the presence of an unexpanded parameter pack, but it is never set. - The error messages don't point out where the unexpanded parameter packs were named in the type/expression, but they should. - We don't check for unexpanded parameter packs in all of the places where we should. - Testing is sparse, pending the resolution of the above three issues. llvm-svn: 121724
* Silence a few more uninitialized-value warningsDouglas Gregor2010-12-101-8/+8
| | | | llvm-svn: 121505
* Fix a compiler warning.Fariborz Jahanian2010-12-101-1/+2
| | | | llvm-svn: 121490
* Added ParenType type node.Abramo Bagnara2010-12-101-7/+13
| | | | llvm-svn: 121488
* It's kindof silly that ExtQuals has an ASTContext&, and we can use thatJohn McCall2010-12-101-1/+1
| | | | | | | | | | space better. Remove this reference. To make that work, change some APIs (most importantly, getDesugaredType()) to take an ASTContext& if they need to return a QualType. Simultaneously, diminish the need to return a QualType by introducing some useful APIs on SplitQualType, which is just a std::pair<const Type *, Qualifiers>. llvm-svn: 121478
* Refactored/cleanedup ActOnFunctionDeclarator Fariborz Jahanian2010-12-091-521/+563
| | | | | | | and ActOnVariableDeclarator No functionality change. // rdar://8751949 llvm-svn: 121427
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-071-4/+4
| | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. llvm-svn: 121121
* Use Sema::MaybeCreateExprWithCleanups() only after we've checked for a ↵Douglas Gregor2010-12-071-2/+2
| | | | | | NULL/invalid expression llvm-svn: 121081
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-3/+3
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* Added struct/class syntactic info for c++0x scoped enum.Abramo Bagnara2010-12-031-2/+3
| | | | llvm-svn: 120828
* Sema/AST work for capturing copy init expressionFariborz Jahanian2010-12-011-0/+21
| | | | | | | to be used in copy helper synthesis of __block variables. wip. llvm-svn: 120617
* Improve the diagnostic when the fixed underlying type of aDouglas Gregor2010-12-011-1/+4
| | | | | | | redeclaration of an enum type differs from that of the original declaration, from Daniel Wallin llvm-svn: 120577
* Microsoft C anonymous struct implementation.Francois Pichet2010-11-231-29/+95
| | | | | | Documentation: http://msdn.microsoft.com/en-us/library/z2cx9y4f.aspx llvm-svn: 120000
* Major anonymous union/struct redesign.Francois Pichet2010-11-211-6/+27
| | | | | | | | | | | A new AST node is introduced: def IndirectField : DDecl<Value>; IndirectFields are injected into the anonymous's parent scope and chain back to the original field. Name lookup for anonymous entities now result in an IndirectFieldDecl instead of a FieldDecl. There is no functionality change, the code generated should be the same. llvm-svn: 119919
* Refactoring.Argyrios Kyrtzidis2010-11-191-1/+1
| | | | | | Move ErrorTrap from clang/Sema to clang/Basic as DiagnosticErrorTrap and use it in Scope. llvm-svn: 119763
* Remove the getDiagnosticLevel check since it doesn't buy us much.Argyrios Kyrtzidis2010-11-181-3/+1
| | | | llvm-svn: 119719
* -Rename -Wargument-larger-than -> -Wlarge-by-value-copyArgyrios Kyrtzidis2010-11-181-3/+7
| | | | | | | | | -Improve the diagnostic message -Add some comments Suggestions by Chris. llvm-svn: 119594
* Introduce option -Wargument-larger-than[=N] which warns about function ↵Argyrios Kyrtzidis2010-11-171-1/+37
| | | | | | | | | | definitions if they take by-value or return by-value any POD that is larger than some threshold (default is 64 bytes). Implements rdar://8548050. llvm-svn: 119583
* A union cannot contain static data members or data members of reference type.Anders Carlsson2010-11-071-11/+30
| | | | llvm-svn: 118381
* 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
OpenPOWER on IntegriCloud