summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement the C++0x deduced 'auto' feature.Richard Smith2011-02-201-45/+133
| | | | | | This fixes PR 8738, 9060 and 9132. llvm-svn: 126069
* Remove the Fix-It for "main must return 'int'", which is not alwaysDouglas Gregor2011-02-191-8/+1
| | | | | | correct and is not worth fixing. Fixes PR8396. llvm-svn: 126035
* Switch labels over to using normal name lookup, instead of their Chris Lattner2011-02-181-5/+14
| | | | | | | own weird little DenseMap. Hey look, we now emit unused label warnings deterministically, amazing. llvm-svn: 125813
* Step #2/N of __label__ support: keep pushing LabelDecl forward,Chris Lattner2011-02-171-4/+10
| | | | | | | | | | making them be template instantiated in a more normal way and make them handle attributes like other decls. This fixes the used/unused label handling stuff, making it use the same infrastructure as other decls. llvm-svn: 125771
* Step #1/N of implementing support for __label__: split labels intoChris Lattner2011-02-171-40/+1
| | | | | | | | | | | | | | | | | | | LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
* Reject forbidden storage class specifiers in OpenCL. Patch by George Russell!Peter Collingbourne2011-02-111-2/+2
| | | | llvm-svn: 125399
* AST, Sema, Serialization: keep track of cudaConfigureCallPeter Collingbourne2011-02-091-0/+13
| | | | llvm-svn: 125216
* In Sema::CheckShadow, get the DeclContext from the variable that we are checkingArgyrios Kyrtzidis2011-02-081-4/+3
| | | | | | | | instead from the Scope; Inner scopes in bodies don't have DeclContexts associated with them. Fixes http://llvm.org/PR9160 & rdar://problem/8966163. llvm-svn: 125097
* Support for objextive-c++ use of property-dot syntax as receiverFariborz Jahanian2011-02-081-4/+6
| | | | | | | in liu of a class method getter. // rdar://8962253 llvm-svn: 125094
* When the out-of-line definition differs from the declaration in the return type,Argyrios Kyrtzidis2011-02-051-1/+5
| | | | | | | | | say "out-of-line definition differ from the declaration in the return type" instead of the silly "functions that differ only in their return type cannot be overloaded". Addresses rdar://7980179. llvm-svn: 124939
* Tweak my fix for PR8748, and update the incorrect PR number in the test case.Douglas Gregor2011-02-041-1/+2
| | | | llvm-svn: 124863
* Tighten up the semantics of default template arguments, per C++0xDouglas Gregor2011-02-041-2/+8
| | | | | | [temp.param]p9 and C++ DR226. Fixes PR8747. llvm-svn: 124856
* Implement -Woverloaded-virtual.Argyrios Kyrtzidis2011-02-031-1/+1
| | | | | | | | | | | | The difference with gcc is that it warns if you overload virtual methods only if the method doesn't also override any method. This is to cut down on the number of warnings and make it more useful like reported here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20423. If we want to warn that not all overloads are overriden we can have an additional warning like -Wpartial-override. -Woverloaded-virtual, unlike gcc, is added to -Wmost. Addresses rdar://8757630. llvm-svn: 124805
* The code trying to assign a typedef to an anonymous tag declaration wasJohn McCall2011-02-011-8/+37
| | | | | | | | extremely rambunctious, both on parsing and on template instantiation. Calm it down, fixing an internal consistency assert on anonymous enum instantiation manglings. llvm-svn: 124653
* Don't warn that variables in C++ static member functions shadow fields. ↵Argyrios Kyrtzidis2011-01-311-0/+6
| | | | | | Fixes rdar://8900456. llvm-svn: 124581
* Fix the diagnostic when we are shadowing an external variable and there ↵Argyrios Kyrtzidis2011-01-311-13/+24
| | | | | | exists a locally scoped extern with the same name. llvm-svn: 124580
* Diagnose if extern local variable is followed by non-extern and vice-versa.Argyrios Kyrtzidis2011-01-311-0/+14
| | | | llvm-svn: 124579
* 'extern' variables in functions don't shadow externs in global scope. Fixes ↵Argyrios Kyrtzidis2011-01-311-0/+13
| | | | | | rdar://8883302. llvm-svn: 124578
* Rvalue references for *this: parse ref-qualifiers.Douglas Gregor2011-01-261-1/+2
| | | | llvm-svn: 124276
* Disallow function template partial specializations, from HansDouglas Gregor2011-01-241-2/+4
| | | | | | Wennborg! Fixes PR8295. llvm-svn: 124135
* Use attributes for all the override control specifiers.Anders Carlsson2011-01-241-2/+4
| | | | llvm-svn: 124122
* Get rid of [[hiding]], [[override]] and [[base_check]].Anders Carlsson2011-01-231-47/+0
| | | | llvm-svn: 124087
* Null initialize a few variables flagged byTed Kremenek2011-01-231-1/+1
| | | | | | | | | | clang's -Wuninitialized-experimental warning. While these don't look like real bugs, clang's -Wuninitialized-experimental analysis is stricter than GCC's, and these fixes have the benefit of being general nice cleanups. llvm-svn: 124072
* Mark classes as final or explicit. Diagnose when a class marked 'final' is ↵Anders Carlsson2011-01-221-0/+4
| | | | | | used as a base. llvm-svn: 124039
* A member function template cannot be virtual.Anders Carlsson2011-01-221-1/+8
| | | | llvm-svn: 124031
* Sema: process non-inheritable attributes on function declarations earlyPeter Collingbourne2011-01-211-22/+26
| | | | | | | This allows us to simplify the handling for the overloadable attribute, removing a number of FIXMEs. llvm-svn: 123961
* 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
OpenPOWER on IntegriCloud