summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed source range for StaticAssertDecl and LinkageSpecDecl. Fixed source ↵Abramo Bagnara2011-03-081-1/+1
| | | | | | range for declarations using postfix types. llvm-svn: 127251
* Fixed source range for all DeclaratorDecl's.Abramo Bagnara2011-03-081-26/+42
| | | | llvm-svn: 127225
* Detect attempts to provide a specialization of a function within aDouglas Gregor2011-03-081-3/+8
| | | | | | dependent scope and produce an error (rather than crashing). Fixes PR8979. llvm-svn: 127206
* g++ is more permissive regarding flexible arrays.Argyrios Kyrtzidis2011-03-071-5/+12
| | | | | | | | It will accept flexible array in union and also as the sole element of a struct/class. Fixes rdar://9065507. llvm-svn: 127171
* Support explicit template specialization and instantiation for membersDouglas Gregor2011-03-071-10/+19
| | | | | | | | | | | of a C++0x inline namespace within enclosing namespaces, as noted in C++0x [namespace.def]p8. Fixes <rdar://problem/9006349>, a libc++ failure where Clang was rejected an explicit specialization of std::swap (since libc++ puts it into an inline, versioned namespace std::__1). llvm-svn: 127162
* Completed source ranges fixes for all classes inheriting from TypeDecl.Abramo Bagnara2011-03-061-1/+1
| | | | llvm-svn: 127120
* Fixed TypedefDecl and TemplateTypeParameter source range.Abramo Bagnara2011-03-061-0/+1
| | | | llvm-svn: 127119
* Propagate new-style exception spec information to Declarator.Sebastian Redl2011-03-051-2/+2
| | | | llvm-svn: 127111
* When diagnostics are suppressed (e.g., because of code completion), don't ↵Douglas Gregor2011-03-041-1/+2
| | | | | | trigger the ExprTemplates.empty() check at the end of a function body llvm-svn: 127046
* Diagnose destructor templates. Fixes PR7904.Douglas Gregor2011-03-041-1/+8
| | | | llvm-svn: 127042
* Fixed source range for FileScopeAsmDecl. Others source range fixes will follow.Abramo Bagnara2011-03-031-2/+5
| | | | llvm-svn: 126939
* Remove cruftDouglas Gregor2011-03-021-9/+0
| | | | llvm-svn: 126888
* Force CaseStmt to store its child statements in source-code order,Douglas Gregor2011-03-021-0/+9
| | | | | | | which is important for libclang's token-annotation and where's-my-cursor functionality. Fixes <rdar://problem/9004439>. llvm-svn: 126887
* Support a new InheritableAttr subclass, InheritableParamAttr, which isJohn McCall2011-03-021-13/+67
| | | | | | | used for attributes that are okay to inherit when written on a parameter. Dependent on LLVM r126827. llvm-svn: 126828
* Reinstate the introduction of source-location information forDouglas Gregor2011-03-011-8/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | nested-name-speciciers within elaborated type names, e.g., enum clang::NestedNameSpecifier::SpecifierKind Fixes in this iteration include: (1) Compute the type-source range properly for a dependent template specialization type that starts with "template template-id ::", as in a member access expression dep->template f<T>::f() This is a latent bug I triggered with this change (because now we're checking the computed source ranges for dependent template specialization types). But the real problem was... (2) Make sure to set the qualifier range on a dependent template specialization type appropriately. This will go away once we push nested-name-specifier locations into dependent template specialization types, but it was the source of the valgrind errors on the buildbots. llvm-svn: 126765
* Revert r126748, my second attempt at nested-name-specifier sourceDouglas Gregor2011-03-011-28/+8
| | | | | | location information for elaborated types. *sigh* llvm-svn: 126753
* Reinstate r126737, extending the generation of type-source locationDouglas Gregor2011-03-011-8/+28
| | | | | | | | | | | | | | | | | | | | | | | | | information for qualifier type names throughout the parser to address several problems. The commit message from r126737: Push nested-name-specifier source location information into elaborated name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind". Aside from the normal changes, this also required some tweaks to the parser. Essentially, when we're looking at a type name (via getTypeName()) specifically for the purpose of creating an annotation token, we pass down the flag that asks for full type-source location information to be stored within the returned type. That way, we retain source-location information involving nested-name-specifiers rather than trying to reconstruct that information later, long after it's been lost in the parser. With this change, test/Index/recursive-cxx-member-calls.cpp is showing much improved results again, since that code has lots of nested-name-specifiers. llvm-svn: 126748
* Revert r126737, the most recent nested-name-specifier location change, for ↵Douglas Gregor2011-03-011-25/+7
| | | | | | buildbot breakage. llvm-svn: 126746
* Push nested-name-specifier source location information into elaboratedDouglas Gregor2011-03-011-7/+25
| | | | | | | | | | | | | | | | | | | name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind". Aside from the normal changes, this also required some tweaks to the parser. Essentially, when we're looking at a type name (via getTypeName()) specifically for the purpose of creating an annotation token, we pass down the flag that asks for full type-source location information to be stored within the returned type. That way, we retain source-location information involving nested-name-specifiers rather than trying to reconstruct that information later, long after it's been lost in the parser. With this change, test/Index/recursive-cxx-member-calls.cpp is showing much improved results again, since that code has lots of nested-name-specifiers. llvm-svn: 126737
* Teach Sema::CheckTypenameType to use nested-name-specifiers withDouglas Gregor2011-02-281-2/+3
| | | | | | | | source-location information. We don't actually preserve this information in any of the resulting TypeLocs (yet), so it doesn't matter. llvm-svn: 126693
* Use NestedNameSpecifierLoc within out-of-line variables, function, andDouglas Gregor2011-02-251-5/+2
| | | | | | | tag definitions. Also, add support for template instantiation of NestedNameSpecifierLocs. llvm-svn: 126470
* Issue AnalysisBasedWarnings as part of calling ↵Ted Kremenek2011-02-231-8/+3
| | | | | | Sema::PopBlockOrFunctionScope(). No real functionality change. llvm-svn: 126287
* Fix PR9276: We were missing the checks for auto deducing to different types ↵Richard Smith2011-02-231-9/+21
| | | | | | in the same declaration group in the template instantiation case. llvm-svn: 126279
* Tweaks to C++0x deduced auto type support:Richard Smith2011-02-211-12/+15
| | | | | | | | * Flag indicating 'we're parsing this auto typed variable's initializer' moved from VarDecl to Sema * Temporary template parameter list for auto deduction is now allocated on the stack. * Deduced 'auto' types are now uniqued. llvm-svn: 126139
* 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
OpenPOWER on IntegriCloud