summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp/temp.decls
Commit message (Collapse)AuthorAgeFilesLines
...
* Test that all of the relevant types properly compute the "containsDouglas Gregor2010-12-151-3/+89
| | | | | | | unexpanded parameter pack" bit and that the recursive AST visitor can then find those unexpanded parameter packs. llvm-svn: 121899
* Introduce a RecursiveASTVisitor subclass that finds all unexpandedDouglas Gregor2010-12-151-3/+18
| | | | | | | | | | | | | | | | parameter packs within a statement, type, etc. Use this visitor to provide improved diagnostics for the presence of unexpanded parameter packs in a full expression, base type, declaration type, etc., by highlighting the unexpanded parameter packs and providing their names, e.g., test/CXX/temp/temp.decls/temp.variadic/p5.cpp:28:85: error: declaration type contains unexpanded parameter packs 'VeryInnerTypes', 'OuterTypes', ... ...VeryInnerTypes, OuterTypes>, pair<InnerTypes, OuterTypes> > types; ~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ^ llvm-svn: 121883
* Variadic templates: extend the Expr class with a bit that specifiesDouglas Gregor2010-12-151-0/+5
| | | | | | | | | | | | | | | | | | whether the expression contains an unexpanded parameter pack, in the same vein as the changes to the Type hierarchy. Compute this bit within all of the Expr subclasses. This change required a bunch of reshuffling of dependency calculations, mainly to consolidate them inside the constructors and to fuse multiple loops that iterate over arguments to determine type dependence, value dependence, and (now) containment of unexpanded parameter packs. Again, testing is painfully sparse, because all of the diagnostics will change and it is more important to test the to-be-written visitor that collects unexpanded parameter packs. llvm-svn: 121831
* Variadic templates: extend Type, NestedNameSpecifier, TemplateName,Douglas Gregor2010-12-131-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Implement C++0x [temp.func.order]p3 (aka DR532) properly. InDouglas Gregor2010-11-152-0/+33
| | | | | | | | | | | | | particular, we only add the implement object parameter type if only one of the function templates is a non-static member function template. Moreover, since this DR differs from existing practice in C++98/03, this commit implements the existing practice (which ignores the first parameter of the function template that is not the non-static member function template) in C++98/03 mode. llvm-svn: 119145
* Instantiate class member template partial specialization declarationsDouglas Gregor2010-11-101-0/+21
| | | | | | | | | in the order they occur within the class template, delaying out-of-line member template partial specializations until after the class has been fully instantiated. This fixes a regression introduced by r118454 (itself a fix for PR8001). llvm-svn: 118704
* When matching template parameter lists to template-ids in a scope specifierJohn McCall2010-10-201-0/+25
| | | | | | | on a friend declaration, skip template-ids which do not depend on the current parameter list. llvm-svn: 116911
* When instantiating a dependently-scoped friend function declaration,John McCall2010-10-191-0/+14
| | | | | | we may need to complete the type before looking into it. llvm-svn: 116795
* Instantiate enclosing template parameter lists when instantiating friends.John McCall2010-10-191-1/+10
| | | | llvm-svn: 116789
* Uncomputable contexts are always records but can exist.John McCall2010-10-191-0/+14
| | | | llvm-svn: 116787
* Redirect templated friend class decls to a new Sema callback andJohn McCall2010-10-191-0/+22
| | | | | | | construct an unsupported friend when there's a friend with a templated scope specifier. Fixes a consistency crash, rdar://problem/8540527 llvm-svn: 116786
* Handle dependent friends more explicitly and deal with the possibilityJohn McCall2010-10-121-8/+53
| | | | | | | | 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
* make clang print types as "const int *" instead of "int const*",Chris Lattner2010-09-051-2/+2
| | | | | | | which is should have done from the beginning. As usual, the most fun with this sort of change is updating all the testcases. llvm-svn: 113090
* Add test case from PR6952, which now works (thanks to Gabor).Douglas Gregor2010-08-301-0/+18
| | | | llvm-svn: 112477
* Revert r111609, which is failing its new test.Douglas Gregor2010-08-201-53/+8
| | | | llvm-svn: 111611
* Detect efforts to declare a template member friend and explicitly ignore them.John McCall2010-08-201-8/+53
| | | | | | Avoids a crash. llvm-svn: 111609
* When checking for equality of template parameter lists, a templateDouglas Gregor2010-06-041-0/+21
| | | | | | type parameter pack is distinct from a template type parameter. llvm-svn: 105464
* I hate this commit.Douglas Gregor2010-05-181-44/+2
| | | | | | | | | | | | | | | | | | | | | Revert much of the implementation of C++98/03 [temp.friend]p5 in r103943 and its follow-ons r103948 and r103952. While our implementation was technically correct, other compilers don't seem to implement this paragraph (which forces the instantiation of friend functions defined in a class template when a class template specialization is instantiated), and doing so broke a bunch of Boost libraries. Since this behavior has changed in C++0x (which instantiates the friend function definitions when they are used), we're going to skip the nowhere-implemented C++98/03 semantics and go straight to the C++0x semantics. This commit is a band-aid to get Boost up and running again. It doesn't really fix PR6952 (which this commit un-fixes), but it does deal with the way Boost.Units abuses this particular paragraph. llvm-svn: 104014
* Diagnose a redefinition error when there are two instantiations of friendDouglas Gregor2010-05-171-5/+17
| | | | | | | functions defined inside a class template. Fixes PR6952, the last Boost.Units failure. llvm-svn: 103952
* Determine when the instantiation of a friend function defined inside aDouglas Gregor2010-05-171-0/+31
| | | | | | | class template conflicts with an existing (non-template) definition. This is another part of PR6952. llvm-svn: 103948
* C++98/03 [temp.friend]p4 requires that inline function definitionsDouglas Gregor2010-05-171-0/+9
| | | | | | | | within class templates be instantiated along with each class template specialization, even if the functions are not used. Do so, as a baby step toward PR6952. llvm-svn: 103943
* When performing partial ordering of class template partialDouglas Gregor2010-04-291-0/+32
| | | | | | | | | specializations, substitute the deduced template arguments and check the resulting substitution before concluding that template argument deduction succeeds. This marvelous little fix makes a bunch of Boost.Spirit tests start working. llvm-svn: 102601
* Recommit my change to how C++ does elaborated type lookups, now withJohn McCall2010-04-231-2/+2
| | | | | | two bugfixes which fix selfhost and (hopefully) the nightly tests. llvm-svn: 102198
* Revert "C++ doesn't really use "namespaces" for different kinds of names the ↵Daniel Dunbar2010-04-231-2/+2
| | | | | | same", which seems to break most C++ nightly test apps. llvm-svn: 102174
* C++ doesn't really use "namespaces" for different kinds of names the sameJohn McCall2010-04-231-2/+2
| | | | | | | | | | | | | way that C does. Among other differences, elaborated type specifiers are defined to skip "non-types", which, as you might imagine, does not include typedefs. Rework our use of IDNS masks to capture the semantics of different kinds of declarations better, and remove most current lookup filters. Removing the last remaining filter is more complicated and will happen in a separate patch. Fixes PR 6885 as well some spectrum of unfiled bugs. llvm-svn: 102164
* Parse friend template ids as types instead of ending up inJohn McCall2010-04-141-0/+17
| | | | | | | ActOnClassTemplateSpecialization and being very confused. Fixes PR6514 (for non-templated-scope friends). llvm-svn: 101198
* Fix an embarrasing memory error. I was apparently very tired when I wrote thisJohn McCall2010-04-131-0/+25
| | | | | | | | code the first time. Fixes PR6827. llvm-svn: 101184
* Fix a crash-on-invalid involving name lookup of tag names, where weDouglas Gregor2010-04-121-3/+3
| | | | | | | ended up finding a function template that we didn't expect. Recover more gracefully, and fix a similar issue for class templates. llvm-svn: 101040
* Turn access control on by default in -cc1.John McCall2010-04-092-4/+4
| | | | | | | | Remove -faccess-control from -cc1; add -fno-access-control. Make the driver pass -fno-access-control by default. Update a bunch of tests to be correct under access control. llvm-svn: 100880
* Set access properly on instantiated friend class template declarations.John McCall2010-04-081-0/+13
| | | | | | Fixes PR6752. llvm-svn: 100806
* Implement dependent friend function template specializations.John McCall2010-04-081-0/+22
| | | | llvm-svn: 100753
* Improve handling of friend types in several ways:Douglas Gregor2010-04-071-2/+1
| | | | | | | | | | | - When instantiating a friend type template, perform semantic analysis on the resulting type. - Downgrade the errors concerning friend type declarations that do not refer to classes to ExtWarns in C++98/03. C++0x allows practically any type to be befriended, and ignores the friend declaration if the type is not a class. llvm-svn: 100635
* Implement method friends in class templates and fix a few related problems.John McCall2010-03-271-0/+25
| | | | llvm-svn: 99708
* Reapply r99596 with a fix: link an instantiated friend function to itsJohn McCall2010-03-261-0/+13
| | | | | | pattern if it has a body. llvm-svn: 99610
* Apparently that didn't work. Reverting for now.John McCall2010-03-261-13/+0
| | | | llvm-svn: 99601
* Properly instantiate and link in friend function templates.John McCall2010-03-261-0/+13
| | | | llvm-svn: 99596
* Handle simple friend-class decls in class templates better by ensuring thatJohn McCall2010-03-251-0/+28
| | | | | | | we look for shadow friend decls in the appropriate scope before injecting a new declaration. llvm-svn: 99552
* Properly instantiate friend class template declarations and link them intoJohn McCall2010-03-251-0/+23
| | | | | | | the redeclaration chain. Recommitted from r99477 with a fix: we need to merge in default template arguments from previous declarations. llvm-svn: 99496
* Revert 99477 since it appears to be breaking the clang-x86_64-darwin10-fntBob Wilson2010-03-251-14/+0
| | | | | | | | | | | buildbot. The tramp3d test fails. --- Reverse-merging r99477 into '.': U test/SemaTemplate/friend-template.cpp U test/CXX/temp/temp.decls/temp.friend/p1.cpp U lib/Sema/SemaTemplateInstantiateDecl.cpp U lib/Sema/SemaAccess.cpp llvm-svn: 99481
* Properly instantiate and link in friend-class-template declarations.John McCall2010-03-251-0/+14
| | | | llvm-svn: 99477
* Silently drop dependent friend function template specializations,Douglas Gregor2010-03-241-1/+11
| | | | | | | | since we have absolutely no way to match them when they are declared nor do we have a way to represent these parsed-but-not-checked friend declarations. llvm-svn: 99407
* Support friend function specializations.John McCall2010-03-241-3/+3
| | | | llvm-svn: 99389
* Implement a framework for the delay of arbitrary diagnostics withinJohn McCall2010-03-241-0/+32
| | | | | | | | | templates. So delay access-control diagnostics when (for example) the target of a friend declaration is a specific specialization of a template. I was surprised to find that this was required for an access-controlled selfhost. llvm-svn: 99383
* Implement non-dependent friend functions and classes.John McCall2010-03-171-1/+32
| | | | llvm-svn: 98764
* When we're parsing template names as part of base-specifiers, we areDouglas Gregor2010-03-011-0/+19
| | | | | | | | *not* entering the context of the nested-name-specifier. This was causing us to look into an uninstantiated template that we shouldn't look into. Fixes PR6376. llvm-svn: 97524
* Migrate the mish-mash of declaration checks inDouglas Gregor2010-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sema::ActOnUninitializedDecl over to InitializationSequence (with default initialization), eliminating redundancy. More importantly, we now check that a const definition in C++ has an initilizer, which was an #if 0'd code for many, many months. A few other tweaks were needed to get everything working again: - Fix all of the places in the testsuite where we defined const objects without initializers (now that we diagnose this issue) - Teach instantiation of static data members to find the previous declaration, so that we build proper redeclaration chains. Previously, we had the redeclaration chain but built it too late to be useful, because... - Teach instantiation of static data member definitions not to try to check an initializer if a previous declaration already had an initializer. This makes sure that we don't complain about static const data members with in-class initializers and out-of-line definitions. - Move all of the incomplete-type checking logic out of Sema::FinalizeDeclaratorGroup; it makes more sense in ActOnUnitializedDecl. There may still be a few places where we can improve these diagnostics. I'll address that as a separate commit. llvm-svn: 95657
* Improve the reporting of non-viable overload candidates by noting the reasonJohn McCall2010-01-132-2/+2
| | | | | | | | why the candidate is non-viable. There's a lot we can do to improve this, but it's a good start. Further improvements should probably be integrated with the bad-initialization reporting routines. llvm-svn: 93277
* Test case for naming of conversion function template specializationsDouglas Gregor2010-01-111-0/+78
| | | | llvm-svn: 93177
* Improve the diagnostics used to report implicitly-generated class membersJohn McCall2010-01-062-2/+2
| | | | | | | | | as parts of overload sets. Also, refer to constructors as 'constructors' rather than functions. Adjust a lot of tests. llvm-svn: 92832
* Switch more of Sema::CheckInitializerTypes over toDouglas Gregor2009-12-192-4/+4
| | | | | | | | | | InitializationSequence. Specially, switch initialization of a C++ class type (either copy- or direct-initialization). Also, make sure that we create an elidable copy-construction when performing copy initialization of a C++ class variable. Fixes PR5826. llvm-svn: 91750
OpenPOWER on IntegriCloud