summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement support for -Wunused-variable, from Oscar Bonilla!Douglas Gregor2009-10-081-0/+6
| | | | llvm-svn: 83577
* Add more testing for the properties of explicit specialization. Douglas Gregor2009-10-081-0/+2
| | | | | | | Also, eliminate a redundant diagnostic by marking a variable declared with incomplete type as an invalid declaration. llvm-svn: 83553
* Don't complain about out-of-line explicit specializations of memberDouglas Gregor2009-10-081-2/+4
| | | | | | | | function and member function templates that are not definitions. Add more tests to ensure that explicit specializations of member function templates prevent instantiation. llvm-svn: 83550
* Improve checking for specializations of member classes of classDouglas Gregor2009-10-081-3/+11
| | | | | | | | | | | templates, and keep track of how those member classes were instantiated or specialized. Make sure that we don't try to instantiate an explicitly-specialized member class of a class template, when that explicit specialization was a declaration rather than a definition. llvm-svn: 83547
* For instantiations of static data members of class templates, keepDouglas Gregor2009-10-081-4/+16
| | | | | | | | track of the kind of specialization or instantiation. Also, check the scope of the specialization and ensure that a specialization declaration without an initializer is not a definition. llvm-svn: 83533
* Refactoring around friend class templates. Better error message for friend ↵John McCall2009-10-071-57/+10
| | | | | | | | enums. Don't create a new declaration for friend classes if a declaration already exists. llvm-svn: 83505
* Type checking for specializations of member functions of classDouglas Gregor2009-10-071-12/+26
| | | | | | | | templates. Previously, these weren't handled as specializations at all. The AST for representing these as specializations is still a work in progress. llvm-svn: 83498
* Refactor the code that walks a C++ inheritance hierarchy, searchingDouglas Gregor2009-10-061-6/+37
| | | | | | | | | for bases, members, overridden virtual methods, etc. The operations isDerivedFrom and lookupInBases are now provided by CXXRecordDecl, rather than by Sema, so that CodeGen and other clients can use them directly. llvm-svn: 83396
* When the return type of a function is dependent, don't perform anyDouglas Gregor2009-10-011-1/+5
| | | | | | | | | | | | of the flow-control checks for falling off the end of a function, since the return type may instantiate to void. Similarly, if a return statement has an expression and the return type of the function is void, don't complain if the expression is type-dependent, since that type could instantiate to void. Fixes PR5071. llvm-svn: 83222
* Add an error for function parameters that have a qualified address space ↵Tanya Lattner2009-09-301-1/+12
| | | | | | since this is not allowed by the embedded c extension spec. llvm-svn: 83165
* Provide a custom diagnostic when code tries to use an unknown builtinDouglas Gregor2009-09-281-5/+6
| | | | llvm-svn: 83014
* Make sure that out-of-line function and variable definitions are notDouglas Gregor2009-09-281-2/+10
| | | | | | pushed into scope. Fixes PR5056. llvm-svn: 83003
* Teach Sema::isDeclInScope to handle overload sets constructed fromDouglas Gregor2009-09-281-4/+41
| | | | | | | | | | | | | | | | | functions that occur in multiple declaration contexts, e.g., because some were found via using declarations. Now, isDeclInScope will build a new overload set (when needed) containing only those declarations that are actually in scope. This eliminates a problem found with libstdc++'s <iostream>, where the presence of using In the longer term, I'd like to eliminate Sema::isDeclInScope in favor of better handling of the RedeclarationOnly flag in the name-lookup routines. That way, name lookup only returns the entities that matter, rather than taking the current two-pass approach of producing too many results and then filtering our the wrong results. It's not efficient, and I'm sure that we aren't filtering everywhere we should be. llvm-svn: 82954
* Rework the Parse-Sema interaction for friends to better support friendDouglas Gregor2009-09-261-6/+55
| | | | | | | | | class templates. We now treat friend class templates much more like normal class templates, except that they still get special name lookup rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in <iostream>. llvm-svn: 82848
* Use explicitly-specified template argument lists to help namingDouglas Gregor2009-09-251-8/+42
| | | | | | explicit template specializations, when available. llvm-svn: 82824
* Declarators can now properly represent template-ids, e.g., forDouglas Gregor2009-09-251-0/+11
| | | | | | | | | | | template void f<int>(int); ~~~~~~ Previously, we silently dropped the template arguments. With this change, we now use the template arguments (when available) as the explicitly-specified template arguments used to aid template argument deduction for explicit template instantiations. llvm-svn: 82806
* WIP implementation of explicit function template specialization. ThisDouglas Gregor2009-09-241-5/+21
| | | | | | | | | | | | | | | | | | | | | first implementation recognizes when a function declaration is an explicit function template specialization (based on the presence of a template<> header), performs template argument deduction + ambiguity resolution to determine which template is being specialized, and hooks There are many caveats here: - We completely and totally drop any explicitly-specified template arguments on the floor - We don't diagnose any of the extra semantic things that we should diagnose. - I haven't looked to see that we're getting the right linkage for explicit specializations On a happy note, this silences a bunch of errors that show up in libstdc++'s <iostream>, although Clang still can't get through the entire header. llvm-svn: 82728
* Refactor the representation of qualifiers to bring ExtQualType out of theJohn McCall2009-09-241-4/+6
| | | | | | | | Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our use of qualifiers and fix a few places that weren't dealing with qualifiers quite right; many more remain. llvm-svn: 82705
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-13/+13
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* Merge uninstantiated default arguments more carefully, and try not toDouglas Gregor2009-09-171-1/+3
| | | | | | | complain about specializations of member functions that are not definitions. Fixes PR4995. llvm-svn: 82159
* Improved representation and support for friend class templates. Angst about ↵John McCall2009-09-161-1/+5
| | | | | | same. llvm-svn: 82088
* When implicitly declaring operators new, new[], delete, and delete[],Douglas Gregor2009-09-151-15/+19
| | | | | | | | | | | | give them the appropriate exception specifications. This, unfortunately, requires us to maintain and/or implicitly generate handles to namespace "std" and the class "std::bad_alloc". However, every other approach I've come up with was more hackish, and this standard requirement itself is quite the hack. Fixes PR4829. llvm-svn: 81939
* Perform the C++ specific semantic checks of a function declaration after ↵Anders Carlsson2009-09-131-41/+41
| | | | | | it's been merged with the previous declaration. This ensures that getPreviousDecl() will have the right value when ActOnConversionDeclarator is called. llvm-svn: 81720
* Rework the way we determine whether an externally visible symbol isDouglas Gregor2009-09-131-35/+2
| | | | | | | | generated for an inline function definition, taking into account C99 and GNU inline/extern inline semantics. This solution is simpler, cleaner, and fixes PR4536. llvm-svn: 81670
* Remove unnecessary ASTContext parameter from FunctionDecl::isBuiltinIDDouglas Gregor2009-09-121-3/+3
| | | | llvm-svn: 81590
* Remove unnecessary ASTContext parameters from isMain and isExternCDouglas Gregor2009-09-121-8/+9
| | | | llvm-svn: 81589
* Support elaborated dependent types and diagnose tag mismatches.John McCall2009-09-111-1/+11
| | | | llvm-svn: 81504
* Don't bother to perform any initialization for a variable declarationDouglas Gregor2009-09-091-4/+12
| | | | | | | of class type whose default constructor is trivial. Should un-break testing on x86_64-pc-linux-gnu. llvm-svn: 81405
* Improve handling of initialization by constructor, by ensuring thatDouglas Gregor2009-09-091-18/+15
| | | | | | | | such initializations properly convert constructor arguments and fill in default arguments where necessary. This also makes the ownership model more clear. llvm-svn: 81394
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-361/+361
| | | | llvm-svn: 81346
* Fix a thinkoDouglas Gregor2009-09-091-2/+8
| | | | llvm-svn: 81317
* Allow a declaration of an array to complete a prior, incompleteDouglas Gregor2009-09-091-0/+7
| | | | | | declaration of that array in C++. llvm-svn: 81309
* Fix PR4922, where Sema would complete tentative definitions in nondeterminsticChris Lattner2009-09-081-7/+16
| | | | | | | | | | order because it was doing so while iterating over a densemap. There are still similar problems in other places, for example WeakUndeclaredIdentifiers is still written to the PCH file in a nondeterminstic order, and we emit warnings about #pragma weak in nondeterminstic order. llvm-svn: 81236
* BuildCXXConstructExpr now takes a MultiExprArg.Anders Carlsson2009-09-071-1/+2
| | | | llvm-svn: 81160
* Start emitting ElaboratedTypes in C++ mode. Support the effort in variousJohn McCall2009-09-051-1/+1
| | | | | | | | ways: remove elab types during desugaring, enhance pretty-printing to allow tags to be suppressed without suppressing scopes, look through elab types when associating a typedef name with an anonymous record type. llvm-svn: 81065
* Correctly handle elaborated template ids. Still not handled properly for ↵John McCall2009-09-041-8/+1
| | | | | | friends. llvm-svn: 80977
* Patch to instantiate destructors used to destructFariborz Jahanian2009-09-031-1/+1
| | | | | | base and data members when they are needed. llvm-svn: 80967
* Borrow a friend class's previous declaration's access specifier regardless ofJohn McCall2009-09-021-5/+5
| | | | | | | | whether the current context is dependent. Thanks to Anders for pointing this out. llvm-svn: 80828
* When adding a friend class declaration to the lookup tables, use the access ↵John McCall2009-09-021-0/+5
| | | | | | | | | | specifier of any previous declaration in case we replace it in a class's declaration table. Fixes bug 4858. This sort of thing makes me reconsider putting friend declarations in declaration lists. llvm-svn: 80750
* Ensure that the tag decls of friend decls aren't added to the friending class'sJohn McCall2009-09-021-1/+9
| | | | | | | decl list, and remove some workarounds that were due to this. Thanks to Eli for pointing this out and providing the test case. llvm-svn: 80745
* Fix bug 4784 and allow friend declarations to properly extendJohn McCall2009-08-311-2/+3
| | | | | | existing declaration chains. llvm-svn: 80636
* Improve diagnostics for missing members. This renames the ↵Anders Carlsson2009-08-301-2/+4
| | | | | | err_typecheck_no_member to err_typecheck_no_member_deprecated. The idea is that err_typecheck_no_member_deprecated should be phased out and any call sites that reference it should call DiagnoseMissingMember instead. llvm-svn: 80469
* Add another check for UnresolvedUsingDecl.Anders Carlsson2009-08-291-4/+7
| | | | llvm-svn: 80412
* Make sure we actually found a redeclaration before complaining about ↵Douglas Gregor2009-08-281-1/+1
| | | | | | attributes added to a redeclaration in C++ llvm-svn: 80403
* Check for UnresolvedUsingDecl when determining if a declaration is a ↵Anders Carlsson2009-08-281-1/+1
| | | | | | redeclaration or not. llvm-svn: 80383
* Omnibus friend decl refactoring. Instead of cloning AST classes for friendJohn McCall2009-08-281-9/+13
| | | | | | | | | | | | | | declarations of same, introduce a single AST class and add appropriate bits (encoded in the namespace) for whether a decl is "real" or not. Much hackery about previously-declared / not-previously-declared, but it's essentially mandated by the standard that friends alter lookup, and this is at least fairly non-intrusive. Refactor the Sema methods specific to friends for cleaner flow and less nesting. Incidentally solve a few bugs, but I remain confident that we can put them back. llvm-svn: 80353
* Back out bad piece of r80272. Will look at fixing this a different way.Eli Friedman2009-08-271-4/+1
| | | | llvm-svn: 80273
* PR4794: Make instantiating friend class decls not crash.Eli Friedman2009-08-271-1/+4
| | | | llvm-svn: 80272
* Implement instantiation of the declarations of member functionDouglas Gregor2009-08-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | templates within class templates, producing a member function template of a class template specialization. If you can parse that, I'm sorry. Example: template<typename T> struct X { template<typename U> void f(T, U); }; When we instantiate X<int>, we now instantiate the declaration X<int>::f, which looks like this: template<typename U> void X<int>::f(int, U); The path this takes through TemplateDeclInstantiator::VisitCXXMethodDecl is convoluted and ugly, but I don't know how to improve it yet. I'm resting my hopes on the multi-level substitution required to instantiate definitions of nested templates, which may simplify this code as well. More testing to come... llvm-svn: 80252
* Bye-bye old RequireCompleteType.Anders Carlsson2009-08-261-1/+2
| | | | llvm-svn: 80182
OpenPOWER on IntegriCloud