summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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 performing template argument deduction against a template-id,Douglas Gregor2010-11-021-0/+22
| | | | | | | only keep deduction results for successful deductions, so that they can be compared against each other. Fixes PR8462, from Richard Smith! llvm-svn: 117983
* Diagnose the declaration of template template parameters thatDouglas Gregor2010-10-211-2/+4
| | | | | | | | themselves have no template parameters. This is actually a restriction due to the grammar of template template parameters, but we choose to diagnose it in Sema to provide better recovery. llvm-svn: 117032
* 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
* Teach the warning about unnamed/local types in template arguments toDouglas Gregor2010-10-131-2/+2
| | | | | | | actually walk the template argument type to find any unnamed/local types within it. Fixes PR6784. llvm-svn: 116382
* Introduce support for emitting diagnostics (warnings + their notes)Douglas Gregor2010-10-121-2/+23
| | | | | | | | | | | | | | | that are suppressed during template argument deduction. This change queues diagnostics computed during template argument deduction. Then, if the resulting function template specialization or partial specialization is chosen by overload resolution or partial ordering (respectively), we will emit the queued diagnostics at that point. This addresses most of PR6784. However, the check for unnamed/local template arguments (which existed before this change) is still only skin-deep, and needs to be extended to look deeper into types. It must be improved to finish PR6784. llvm-svn: 116373
* 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
* When finalizing a function template specialization following templateDouglas Gregor2010-10-121-0/+9
| | | | | | | | | | argument deduction, make sure to check the correctness of deduced template type arguments (which we had previously skipped) along with other kinds of template arguments. This fixes part of PR6784, but we're still swallowing the extension warning about unnamed/local template arguments. llvm-svn: 116327
* Progress.John McCall2010-10-121-1/+1
| | | | llvm-svn: 116287
* Parentheses around address non-type template argument is demoted to an ↵Abramo Bagnara2010-09-131-1/+1
| | | | | | extension warning. llvm-svn: 113739
* Diagnose the instantiation of variables (including static dataDouglas Gregor2010-09-121-0/+12
| | | | | | members) with function type. Fixes PR8047. llvm-svn: 113723
* When diagnosing C++ [temp.expl.spec]p3 in C++98/03 mode, downgrade theDouglas Gregor2010-09-122-7/+246
| | | | | | | | | | | error to a warning if we're in a case that would be allowed in C++0x. This "fixes" PR8084 by making Clang accept more code than GCC and (non-strict) EDG do. Also, add the missing test case for the C++0x semantics, which should have been in r113717. llvm-svn: 113718
* remove curly quotes, patch by Dimitry Andric!Chris Lattner2010-09-061-1/+1
| | | | llvm-svn: 113156
* make clang print types as "const int *" instead of "int const*",Chris Lattner2010-09-052-9/+9
| | | | | | | 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
* Allow anonymous and local types. The support was already in place for these,Chandler Carruth2010-09-031-0/+20
| | | | | | but this makes them work even as an extension in C++98. This resolves PR8077. llvm-svn: 113011
* When instantiating a function type, instantiate the return type beforeDouglas Gregor2010-08-311-1/+26
| | | | | | | | | | | | | | | | | | | instantiating the parameters. In a perfect world, this wouldn't matter, and compilers are free to instantiate in any order they want. However, every other compiler seems to instantiate the return type first, and some code (in this case, Boost.Polygon) depends on this and SFINAE to avoid instantiating something that shouldn't be instantiated. We could fight this battle, and insist that Clang is allowed to do what it does, but it's not beneficial: it's more predictable to instantiate this way, in source order. When we implement late-specified return types, we'll need to instantiate the return type last when it was late-specified, hence the FIXME. We now compile Boost.Polygon properly. llvm-svn: 112561
* Perform the function-to-pointer adjustment during template argumentDouglas Gregor2010-08-301-0/+18
| | | | | | | | | deduction where the parameter is a function reference, function pointer, or member function pointer and the argument is an overloaded function. Fixes <rdar://problem/8360106>, a template argument deduction issue found by Boost.Filesystem. llvm-svn: 112523
* Add test case from PR6952, which now works (thanks to Gabor).Douglas Gregor2010-08-301-0/+18
| | | | llvm-svn: 112477
* Support explicit instantiation of function templates and members of classChandler Carruth2010-08-251-1/+26
| | | | | | | | | | | | | templates when only the declaration is in scope. This requires deferring the instantiation to be lazy, and ensuring the definition is required for that translation unit. We re-use the existing pending instantiation queue, previously only used to track implicit instantiations which were required to be lazy. Fixes PR7979. A subsequent change will rename *PendingImplicitInstantiations to *PendingInstatiations for clarity given its broader role. llvm-svn: 112037
* 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
* Get rid of isObjectType; when C++ says "object type", it generallyEli Friedman2010-08-051-1/+2
| | | | | | | just means "not a function type", not "not a function type or void". This changes behavior slightly, but generally in a way which accepts more code. llvm-svn: 110303
* When determining whether an overload set with explicit templateDouglas Gregor2010-07-141-0/+20
| | | | | | | arguments only resolves to a single specialization, make sure to look through using declarations. Fixes PR7641. llvm-svn: 108376
* Reinstate the optimization suppressing available_externally functionsDouglas Gregor2010-07-131-1/+1
| | | | | | | | at -O0. The only change from the previous patch is that we don't try to generate virtual method thunks for an available_externally function. llvm-svn: 108230
* Speculatively revert r108156; it appears to be breaking self-host.Douglas Gregor2010-07-121-1/+1
| | | | llvm-svn: 108194
* Do not generate LLVM IR for available_externally function bodies atDouglas Gregor2010-07-121-1/+1
| | | | | | | | | | -O0, since we won't be using the definitions for anything anyway. For lib/System/Path.o when built in Debug+Asserts mode, this leads to a 4% improvement in compile time (and suppresses 440 function bodies). <rdar://problem/7987644> llvm-svn: 108156
* Partial fix for PR7267 based on comments by John McCall on an earlier patch.Chandler Carruth2010-06-281-0/+18
| | | | | | | | | | | | | | | | | | This is more targeted, as it simply provides toggle actions for the parser to turn access checking on and off. We then use these to suppress access checking only while we parse the template-id (included scope specifier) of an explicit instantiation and explicit specialization of a class template. The specialization behavior is an extension, as it seems likely a defect that the standard did not exempt them as it does explicit instantiations. This allows the very common practice of specializing trait classes to work for private, internal types. This doesn't address instantiating or specializing function templates, although those apparently already partially work. The naming and style for the Action layer isn't my favorite, comments and suggestions would be appreciated there. llvm-svn: 106993
* Downgrade the error when using a typedef in the nested-name-specifierDouglas Gregor2010-06-161-3/+3
| | | | | | | of an explicit instantiation to an ExtWarn, since nobody else seems to diagnose this problem. llvm-svn: 106109
* 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
* Properly disambiguate between an elaborated-type-specifier and aDouglas Gregor2010-06-041-0/+5
| | | | | | type-parameter within a template parameter list. Found by inspection. llvm-svn: 105462
* Reinstate r104117, Chandler Carruth's change that "[provides] a namingDouglas Gregor2010-05-201-0/+13
| | | | | | | class for UnresolvedLookupExprs, even when occuring on template names" along with a fix for an Objective-C++ crasher it introduced. llvm-svn: 104277
* Revert r104117, "Provide a naming class for UnresolvedLookupExprs, even whenDaniel Dunbar2010-05-191-13/+0
| | | | | | | occuring on..." which breaks some Objective-C code. Working on getting a test case... llvm-svn: 104150
* Provide a naming class for UnresolvedLookupExprs, even when occuring onChandler Carruth2010-05-191-0/+13
| | | | | | | | | | | template names. We were completely missing naming classes for many unqualified lookups, but this didn't trigger code paths that need it. This removes part of an optimization that re-uses the template name lookup done by the parser to determine if explicit template arguments actually form a template-id. Unfortunately the technique for avoiding the duplicate lookup lost needed data such as the class context in which the lookup succeeded. llvm-svn: 104117
* 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
* The C++98/03 standard is disturbingly silent about out-of-scopeDouglas Gregor2010-05-112-3/+3
| | | | | | | | | | explicit instantiations of template. C++0x clarifies the intent (they're ill-formed in some cases; see [temp.explicit] for details). However, one could squint at the C++98/03 standard and conclude they are permitted, so reduce the error to a warning (controlled by -Wc++0x-compat) in C++98/03 mode. llvm-svn: 103482
* When printing an overload candidate that failed due to SFINAE, print aDouglas Gregor2010-05-081-2/+2
| | | | | | | | | | | specific message that includes the template arguments, e.g., test/SemaTemplate/overload-candidates.cpp:27:20: note: candidate template ignored: substitution failure [with T = int *] typename T::type get_type(const T&); // expected-note{{candidate ... ^ llvm-svn: 103348
* When template argument deduction fails because the call had tooDouglas Gregor2010-05-081-1/+1
| | | | | | | many/too few arguments, use the same diagnostic we use for arity mismatches in non-templates (but note that it's a function template). llvm-svn: 103341
* When printing a non-viable overload candidate that failed due toDouglas Gregor2010-05-082-2/+3
| | | | | | | | | | | | conflicting deduced template argument values, give a more specific reason along with those values, e.g., test/SemaTemplate/overload-candidates.cpp:4:10: note: candidate template ignored: deduced conflicting types for parameter 'T' ('int' vs. 'long') const T& min(const T&, const T&); ^ llvm-svn: 103339
* 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
OpenPOWER on IntegriCloud