summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Generalise support for non-inheritable attributesPeter Collingbourne2011-01-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Inheritable attributes on declarations may be inherited by any later redeclaration at merge time. By contrast, a non-inheritable attribute will not be inherited by later redeclarations. Non-inheritable attributes may be semantically analysed early, allowing them to influence the redeclaration/overloading process. Before this change, the "overloadable" attribute received special handling to be treated as non-inheritable, while all other attributes were treated as inheritable. This patch generalises the concept, while removing a FIXME. Some CUDA location attributes are also marked as non-inheritable in order to support special overloading semantics (to be introduced in a later patch). The patch introduces a new Attr subclass, InheritableAttr, from which all inheritable attributes derive. Non-inheritable attributes simply derive from Attr. N.B. I did not review every attribute to determine whether it should be marked non-inheritable. This can be done later on an incremental basis, as this change does not affect default functionality. llvm-svn: 123959
* Diagnose when a virtual member function marked final is overridden.Anders Carlsson2011-01-201-1/+1
| | | | llvm-svn: 123916
* Diagnose virtual member functions marked override but not overriding any ↵Anders Carlsson2011-01-201-1/+2
| | | | | | virtual member functions. llvm-svn: 123888
* Fix PR8884 by skipping transparent contexts. The test is for LikageSpec. IRafael Espindola2011-01-201-1/+1
| | | | | | | failed to find a case where an enum context would make a difference, but found PR9007 on the way. llvm-svn: 123871
* When building the copy expression for a __block variable, make sureJohn McCall2011-01-191-47/+50
| | | | | | | there's a respectable point of instantiation. Also, make sure we do this operation even when instantiating a dependently-typed variable. llvm-svn: 123818
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-191-3/+4
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* Added warning about invalid register specification for local variables.Abramo Bagnara2011-01-111-4/+18
| | | | llvm-svn: 123236
* Initial implementation of function parameter packs. This implementation allows:Douglas Gregor2011-01-051-6/+0
| | | | | | | | | | | | | | 1) Declaration of function parameter packs 2) Instantiation of function parameter packs within function types. 3) Template argument deduction of function parameter packs when matching two function types. We're missing all of the important template-instantiation logic for function template definitions, along with template argument deduction from the argument list of a function call, so don't even think of trying to use these for real yet. llvm-svn: 122926
* When in code-completion, skip obj-c method bodies for speed up.Argyrios Kyrtzidis2011-01-031-1/+2
| | | | llvm-svn: 122781
* Fix PR8841 by checking for both semantic and lecical dependentChandler Carruth2011-01-031-1/+2
| | | | | | | contexts. This prevents -Wunused-function from firing on friend function definitions inside of class templates for example. llvm-svn: 122763
* When we attempt to create a built-in that involves a library type weDouglas Gregor2011-01-031-2/+2
| | | | | | | | | don't have access to (e.g., fprintf, which needs the library type FILE), fail with a warning and forget about the builtin entirely. Previously, we would actually provide an error, which breaks autoconf's super-lame checks for fprintf, longjmp, etc. Fixes PR8316. llvm-svn: 122744
* Produce a better error message for invalid register names.Rafael Espindola2011-01-011-1/+5
| | | | llvm-svn: 122670
* Refactor how we collect attributes during parsing, and add slots for attributesJohn McCall2010-12-241-2/+3
| | | | | | | on array and function declarators. This is pretty far from complete, and I'll revisit it later if someone doesn't beat me to it. llvm-svn: 122535
* Implement parsing of function parameter packs and non-type templateDouglas Gregor2010-12-231-17/+24
| | | | | | | | | | | | parameter packs (C++0x [dcl.fct]p13), including disambiguation between unnamed function parameter packs and varargs (C++0x [dcl.fct]p14) for cases like void f(T...) where T may or may not contain unexpanded parameter packs. llvm-svn: 122520
* Change all self assignments X=X to (void)X, so that we can turn on aJeffrey Yasskin2010-12-231-1/+1
| | | | | | | | | new gcc warning that complains on self-assignments and self-initializations. Fix one bug found by the warning, in which one clang::OverloadCandidate constructor failed to initialize its FunctionTemplate member. llvm-svn: 122459
* In C++, if the user redeclares a builtin function with a type that isDouglas Gregor2010-12-211-0/+12
| | | | | | | | | | | | | | | inconsistent with the type that the builtin *should* have, forget about the builtin altogether: we don't want subsequence analyses, CodeGen, etc., to think that we have a proper builtin function. C is protected from errors here because it allows one to use a library builtin without having a declaration, and detects inconsistent (re-)declarations of builtins during declaration merging. C++ was unprotected, and therefore would crash. Fixes PR8839. llvm-svn: 122351
* Fix the noreturn conversion to only strip off a single level of indirection.John McCall2010-12-211-2/+0
| | | | | | | Apply the noreturn attribute while creating a builtin function's type. Remove the getNoReturnType() API. llvm-svn: 122295
* Motions towards simplifying how we deal with attribute-qualified function types.John McCall2010-12-191-23/+35
| | | | llvm-svn: 122162
* Use hasSameType to compare types for equality.Abramo Bagnara2010-12-171-1/+2
| | | | llvm-svn: 122058
* Avoid to emit redundant implicit cast for enum constants init expressions.Abramo Bagnara2010-12-171-1/+1
| | | | llvm-svn: 122056
* Check for unexpanded parameter packs within variable initializers.Douglas Gregor2010-12-161-19/+26
| | | | llvm-svn: 121938
* Check for unexpanded parameter packs in friend declarations.Douglas Gregor2010-12-161-0/+4
| | | | llvm-svn: 121934
* Check for unexpanded parameter packs in using declarations. As aDouglas Gregor2010-12-161-1/+2
| | | | | | | drive-by, make sure to check for unexpanded parameter packs within the name of a declaration. llvm-svn: 121930
* Check for unexpanded parameter packs in enumeration types and enumerators.Douglas Gregor2010-12-161-0/+9
| | | | llvm-svn: 121928
* Check for unexpanded parameter packs in various kinds ofDouglas Gregor2010-12-151-2/+12
| | | | | | | | declarations. This is a work in progress, as I go through the C++ declaration grammar to identify where unexpanded parameter packs can occur. llvm-svn: 121912
* Fix diagnostic pragmas.Argyrios Kyrtzidis2010-12-151-14/+8
| | | | | | | | | | | | Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state. Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect a lot of places, like C++ inline methods, template instantiations, the lexer, etc. Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location. Fixes rdar://8365684. llvm-svn: 121873
* Set the "implicitly inline" bit on a method as soon as we see a definitionJohn McCall2010-12-151-0/+6
| | | | | | | | within the class. Teach IR gen to look for function definitions in record lexical contexts when deciding whether to emit a function whose address was taken. Fixes PR8789. llvm-svn: 121833
* Added missing IgnoreParens().Abramo Bagnara2010-12-141-2/+2
| | | | llvm-svn: 121795
* Restore r121752 without modification.John McCall2010-12-141-10/+7
| | | | llvm-svn: 121763
* 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
OpenPOWER on IntegriCloud