summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix PR6149 by looking at the qualifiers on the referred to type for non-typeChandler Carruth2010-02-031-0/+70
| | | | | | | reference template arguments. Adds test cases for the cv-quals of reference arguments. llvm-svn: 95217
* FIXME complete.John McCall2010-02-021-1/+0
| | | | llvm-svn: 95059
* Improve the diagnostic used when an incompatible overload set is passedJohn McCall2010-02-021-1/+1
| | | | | | as an argument during overload resolution. llvm-svn: 95057
* Implement C++ [temp.deduct.call]p6, template argument deduction for overloadedJohn McCall2010-02-021-0/+96
| | | | | | | | | | arguments. Fix a bug where incomplete explicit specializations were being passed through as legitimate. Fix a bug where the absence of an explicit specialization in an overload set was causing overall deduction to fail. Fixes PR6191. llvm-svn: 95052
* Note that an overload candidate was non-viable because template argumentJohn McCall2010-02-012-2/+3
| | | | | | | deduction failed. Right now there's a very vague diagnostic for most cases and a good diagnostic for incomplete deduction. llvm-svn: 94988
* Fix PR6159 and several other problems with value-dependent non-type templateChandler Carruth2010-01-311-6/+53
| | | | | | | | | | | | | arguments. This both prevents meaningless checks on these arguments and ensures that they are represented as an expression by the instantiation. Cleaned up and added standard text to the relevant test case. Also started adding tests for *rejected* cases. At least one FIXME here where (I think) we allow something we shouldn't. More to come in the area of rejecting crazy arguments with decent diagnostics. Suggestions welcome for still better diagnostics on these errors! llvm-svn: 94953
* Fix PR6156 and test several of the basic aspects of non-type template argumentsChandler Carruth2010-01-311-0/+33
| | | | | | when implicitly supplied to the injected class name. llvm-svn: 94948
* Handle instantiation of templates with non-type arguments expressed with anChandler Carruth2010-01-311-0/+10
| | | | | | | explicit '&' by introducing an address-of operator prior to checking the argument's type. llvm-svn: 94947
* Improve the reporting of non-viable overload candidates by noting the reasonJohn McCall2010-01-135-5/+5
| | | | | | | | 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
* When resolving a single function template specialization to aDouglas Gregor2010-01-111-0/+33
| | | | | | | function, be sure to adjust the resulting argument type to a pointer (if necessary). Fixes PR5910 and PR5949. llvm-svn: 93178
* Test case for naming of conversion function template specializationsDouglas Gregor2010-01-111-0/+78
| | | | llvm-svn: 93177
* Add test from PR5913, which has already been fixedDouglas Gregor2010-01-061-0/+13
| | | | llvm-svn: 92863
* Improve the diagnostics used to report implicitly-generated class membersJohn McCall2010-01-066-8/+8
| | | | | | | | | as parts of overload sets. Also, refer to constructors as 'constructors' rather than functions. Adjust a lot of tests. llvm-svn: 92832
* Make sure to use ASTContext::getAs*ArrayType() when decomposing arrayDouglas Gregor2010-01-041-0/+2
| | | | | | types. Fixes APFloat.cpp compilation failure. llvm-svn: 92523
* Switch file-scope assignment initialization over to InitializationSequence.Eli Friedman2009-12-222-2/+2
| | | | llvm-svn: 91881
* When a template-id refers to a single function template, and theDouglas Gregor2009-12-211-0/+37
| | | | | | | | | | explicitly-specified template arguments are enough to determine the instantiation, and either template argument deduction fails or is not performed in that context, we can resolve the template-id down to a function template specialization (so sayeth C++0x [temp.arg.explicit]p3). Fixes PR5811. llvm-svn: 91852
* Switch default-initialization of variables of class type (or array thereof) ↵Douglas Gregor2009-12-203-5/+5
| | | | | | over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one llvm-svn: 91796
* Refactor to remove more dependencies on PreDeclaratorDC. I seem to have madeJohn McCall2009-12-191-8/+6
| | | | | | | the redeclaration problems in the [temp.explicit]p3 testcase worse, but I can live with that; they'll need to be fixed more holistically anyhow. llvm-svn: 91771
* Switch more of Sema::CheckInitializerTypes over toDouglas Gregor2009-12-193-6/+6
| | | | | | | | | | 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
* Switch the initialization required by return statements over to theDouglas Gregor2009-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | new InitializationSequence. This fixes some bugs (e.g., PR5808), changed some diagnostics, and caused more churn than expected. What's new: - InitializationSequence now has a "C conversion sequence" category and step kind, which falls back to - Changed the diagnostics for returns to always have the result type of the function first and the type of the expression second. CheckSingleAssignmentConstraints to peform checking in C. - Improved ASTs for initialization of return values. The ASTs now capture all of the temporaries we need to create, but intentionally do not bind the tempoary that is actually returned, so that it won't get destroyed twice. - Make sure to perform an (elidable!) copy of the class object that is returned from a class. - Fix copy elision in CodeGen to properly see through the subexpressions that occur with elidable copies. - Give "new" its own entity kind; as with return values and thrown objects, we don't bind the expression so we don't call a destructor for it. Note that, with this patch, I've broken returning move-only types in C++0x. We'll fix it later, when we tackle NRVO. llvm-svn: 91669
* Introduce a centralized routine in Sema for diagnosing failed lookups (whenJohn McCall2009-12-162-2/+2
| | | | | | | | | used as expressions). In dependent contexts, try to recover by doing a lookup in previously-dependent base classes. We get better diagnostics out, but unfortunately the recovery fails: we need to turn it into a method call expression, not a bare call expression. Thus this is still a WIP. llvm-svn: 91525
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-1579-79/+79
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Fix some diagnostic-related FIXMEs, from Nicola GiganteDouglas Gregor2009-12-151-1/+1
| | | | llvm-svn: 91433
* Diagnose the use of typedefs for template specialization types in the scopeJohn McCall2009-12-151-0/+12
| | | | | | | | specifiers for out-of-line declarations, e.g. typedef Temp<int> MyTemp; template <> MyTemp::foo; llvm-svn: 91395
* Diagnose ill-formed uses of default template arguments inDouglas Gregor2009-11-251-0/+23
| | | | | | | | | | | function templates (in C++98), friend function templates, and out-of-line definitions of members of class templates. Also handles merging of default template arguments from previous declarations of function templates, for C++0x. However, we don't yet make use of those default template arguments. llvm-svn: 89872
* Canonical template arguments that are template template parameters byDouglas Gregor2009-11-231-1/+22
| | | | | | | their template parameter depth and position, so that we can match redeclarations appropriately. Fixes PR5527 and PR5528. llvm-svn: 89654
* Implement C++ [temp.param]p2 correctly, looking ahead when we see aDouglas Gregor2009-11-211-1/+2
| | | | | | | "typename" parameter to distinguish between non-type and type template parameters. Fixes the actual bug in PR5559. llvm-svn: 89532
* Cope with extraneous "template" keyword when providing an out-of-lineDouglas Gregor2009-11-202-1/+11
| | | | | | definition of a member template (or a member thereof). Fixes PR5566. llvm-svn: 89512
* Improve diagnostics when a default template argument does not matchDouglas Gregor2009-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | with its corresponding template parameter. This can happen when we performed some substitution into the default template argument and what we had doesn't match any more, e.g., template<int> struct A; template<typename T, template<T> class X = A> class B; B<long> b; Previously, we'd emit a pretty but disembodied diagnostic showing how the default argument didn't match the template parameter. The diagnostic was good, but nothing tied it to the *use* of the default argument in "B<long>". This commit fixes that. Also, tweak the counting of active template instantiations to avoid counting non-instantiation records, such as those we create for (surprise!) checking default arguments, instantiating default arguments, and performing substitutions as part of template argument deduction. llvm-svn: 86884
* Before checking a template template argument against its correspondingDouglas Gregor2009-11-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | template template parameter, substitute any prior template arguments into the template template parameter. This, for example, allows us to properly check the template template argument for a class such as: template<typename T, template<T Value> class X> struct Foo; The actual implementation of this feature was trivial; most of the change is dedicated to giving decent diagnostics when this substitution goes horribly wrong. We now get a note like: note: while substituting prior template arguments into template template parameter 'X' [with T = float] As part of this change, enabled some very pedantic checking when comparing template template parameter lists, which shook out a bug in our overly-eager checking of default arguments of template template parameters. We now perform only minimal checking of such default arguments when they are initially parsed. llvm-svn: 86864
* Add additional note to mark the cause of synthesized constructors. MarkEli Friedman2009-11-091-1/+1
| | | | | | | declaration invalid if the constructor can't be properly built. Addresses remaining review comments from Fariborz for r86500. llvm-svn: 86579
* Unify the codepaths used to verify base and member initializers for explicitlyEli Friedman2009-11-091-3/+2
| | | | | | | | | | | | | | | | and implicitly defined constructors. This has a number of benefits: 1. Less code. 2. Explicit and implicit constructors get the same diagnostics. 3. The AST explicitly contains constructor calls from implicit default constructors. This allows handing some cases that previously weren't handled correctly in IRGen without any additional code. Specifically, implicit default constructors containing calls to constructors with default arguments are now handled correctly. llvm-svn: 86500
* Remove RUN: true lines.Daniel Dunbar2009-11-081-1/+1
| | | | llvm-svn: 86432
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-1/+1
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* Switch XFAIL format to match LLVM.Daniel Dunbar2009-11-032-2/+2
| | | | llvm-svn: 85880
* Introduce a new class, UnqualifiedId, that provides a parsedDouglas Gregor2009-11-031-2/+2
| | | | | | | | | | | | | | | | representation of a C++ unqualified-id, along with a single parsing function (Parser::ParseUnqualifiedId) that will parse all of the various forms of unqualified-id in C++. Replace the representation of the declarator name in Declarator with the new UnqualifiedId class, simplifying declarator-id parsing considerably and providing more source-location information to Sema. In the future, I hope to migrate all of the other unqualified-id-parsing code over to this single representation, then begin to merge actions that are currently only different because we didn't have a unqualified notion of the name in the parser. llvm-svn: 85851
* Improved fix for PR3844, which recovers better for class templateDouglas Gregor2009-10-301-1/+1
| | | | | | partial specializations and explicit instantiations of non-templates. llvm-svn: 85620
* Improve diagnostics when parsing something likeDouglas Gregor2009-10-302-4/+2
| | | | | | | | template<> struct foo<int> { ... }; where "foo" does not refer to a template. Fixes PR3844. llvm-svn: 85616
* Instantiate class template friends better; fixes PR5332.Douglas Gregor2009-10-301-0/+2
| | | | llvm-svn: 85612
* Implement support for semantic checking and template instantiation ofDouglas Gregor2009-10-291-2/+37
| | | | | | | | class template partial specializations of member templates. Also, fixes a silly little bug in the marking of "used" template parameters in member templates. Fixes PR5236. llvm-svn: 85447
* TestDouglas Gregor2009-10-271-0/+33
| | | | | | | explicit-instantiation-declaration-after-explicit-instantiation-definition errors. This wraps up explicit template instantiation for now. llvm-svn: 85347
* Implement proper linkage for explicit instantiation declarations ofDouglas Gregor2009-10-271-0/+66
| | | | | | | | | | | | | | | | | | | | | inlined functions. For example, given template<typename T> class string { unsigned Len; public: unsigned size() const { return Len; } }; extern template class string<char>; we now give the instantiation of string<char>::size available_externally linkage (if it is ever instantiated!), as permitted by the C++0x standard. llvm-svn: 85340
* Explicit instantiation suppresses the instantiation of non-inlineDouglas Gregor2009-10-271-0/+59
| | | | | | | function template specializations and member functions of class template specializations. llvm-svn: 85300
* An explicit instantiation definition only instantiations those classDouglas Gregor2009-10-271-0/+27
| | | | | | | | | members that have a definition. Also, use CheckSpecializationInstantiationRedecl as part of this instantiation to make sure that we diagnose the various kinds of problems that can occur with explicit instantiations. llvm-svn: 85270
* Test for interaction between explicit instantiations and specializationsDouglas Gregor2009-10-271-0/+36
| | | | llvm-svn: 85244
* Test various aspects of explicit instantiation that were already implemented.Douglas Gregor2009-10-273-0/+38
| | | | llvm-svn: 85243
* Only set the point of instantiation for an implicit or explicitDouglas Gregor2009-10-271-6/+4
| | | | | | | | | | instantiation once we have committed to performing the instantiation. As part of this, make our makeshift template-instantiation location information suck slightly less. Fixes PR5264. llvm-svn: 85209
* Make sure that we're diagnosing duplicate explicit instantiation definitions.Douglas Gregor2009-10-151-0/+29
| | | | llvm-svn: 84189
* Check the interactions between explicit instantiations and templateDouglas Gregor2009-10-151-0/+16
| | | | | | | | specializations. Work in progress; there's more cleanup required to actually use the new CheckSpecializationInstantiationRedecl checker uniformly. llvm-svn: 84185
* Diagnose explicit instantiations of function templates and memberDouglas Gregor2009-10-153-2/+18
| | | | | | | | functions/static data members of class template specializations that do not have definitions. This is the latter part of [temp.explicit]p4; the former part still needs more testing. llvm-svn: 84182
OpenPOWER on IntegriCloud