summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* PR12008: defer adding the implicit 'const' to a constexpr member function untilRichard Smith2013-01-141-4/+21
| | | | | | we know whether it is static. llvm-svn: 172376
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-1/+1
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-26/+26
| | | | llvm-svn: 171367
* Remove duplicate includes.Roman Divacky2012-12-211-1/+0
| | | | llvm-svn: 170903
* Remove code from Sema::ActOnStartOfFunctionTemplateDef that duplicates whatArgyrios Kyrtzidis2012-12-141-7/+1
| | | | | | Sema::ActOnStartOfFunctionDef is already doing. llvm-svn: 170179
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-8/+9
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* SemaCXX: an enumeral type can be of character or boolean type in a C++11 ↵Benjamin Kramer2012-11-211-25/+24
| | | | | | | | enum class. Make sure we create a literal of the right type. Fixes PR14386. llvm-svn: 168441
* Per [basic.lookup.classref]p3, in an expression of the form p->~type-name, theRichard Smith2012-11-151-1/+1
| | | | | | | | | | type-name is looked up in the context of the complete postfix-expression. Don't forget to pass the scope into this lookup when the type-name is a template-id; it might name an alias template which can't be found within the class itself. Bug spotted by Johannes Schaub on #llvm. llvm-svn: 168011
* Fix typo correction of one qualified name to another.David Blaikie2012-10-121-1/+2
| | | | | | | | | | | | | | When suggesting "foo::bar" as a correction for "fob::bar" we mistakenly replaced only "bar" with "foo::bar" producing "fob::foo::bar" which was broken. This corrects that replacement in as many places as I could find & provides test cases for all those cases I could find a test case for. There are a couple that don't seem to be reachable (one looks entirely dead, the other just doesn't seem to ever get called with a namespace to namespace change). Review by Richard Smith ( http://llvm-reviews.chandlerc.com/D57 ). llvm-svn: 165817
* Fix the AST representation for non-type template arguments to encodeEli Friedman2012-09-261-46/+42
| | | | | | | | | | | | enough information so we can mangle them correctly in cases involving dependent parameter types. (This specifically impacts cases involving null pointers and cases involving parameters of reference type.) Fix the mangler to use this information instead of trying to scavenge it out of the parameter declaration. <rdar://problem/12296776>. llvm-svn: 164656
* Remove Context argument from TemplateDeductionInfo constructor. It was no ↵Craig Topper2012-09-191-2/+2
| | | | | | longer needed after the unused Context member was removed in r164104. llvm-svn: 164196
* Remove redundant semicolons which are null statements.Dmitri Gribenko2012-09-101-1/+1
| | | | llvm-svn: 163546
* PR9023: A template template parameter whose template parameter list contains anRichard Smith2012-09-071-125/+156
| | | | | | | | | | | | | unexpanded parameter pack is a pack expansion. Thus, as with a non-type template parameter which is a pack expansion, it needs to be expanded early into a fixed list of template parameters. Since the expanded list of template parameters is not itself a parameter pack, it is permitted to appear before the end of the template parameter list, so also remove that restriction (for both template template parameter pack expansions and non-type template parameter pack expansions). llvm-svn: 163369
* Fixed lexical decl context of out of line class template instantiations.Abramo Bagnara2012-09-051-1/+2
| | | | llvm-svn: 163206
* Now that ASTMultiPtr is nothing more than a array reference, make it a ↵Benjamin Kramer2012-08-231-10/+8
| | | | | | | | MutableArrayRef. This required changing all get() calls to data() and using the simpler constructors. llvm-svn: 162501
* Rip out remnants of move semantic emulation and smart pointers in Sema.Benjamin Kramer2012-08-231-13/+9
| | | | | | | These were nops for quite a while and only lead to confusion. ASTMultiPtr now behaves like a proper dumb array reference. llvm-svn: 162475
* Fix undefined behavior: member function calls where 'this' is a null pointer.Richard Smith2012-08-231-0/+2
| | | | llvm-svn: 162430
* Merge existing attributes before processing pragmas in friend templateRafael Espindola2012-08-221-2/+3
| | | | | | | declarations. Fixes pr13662. llvm-svn: 162360
* Don't forget to apply #pragma pack to partial and explicit specializations ofRichard Smith2012-08-171-0/+7
| | | | | | | class templates. This fixes misalignment issues in llvm/Support/Endian.h when built by Clang. llvm-svn: 162074
* Don't add attributes for "#pragma pack" and friends to tag declarations whichEli Friedman2012-08-081-2/+4
| | | | | | | are not definitions. This follows the behavior of both gcc and earlier versions of clang. Regression from r156531. <rdar://problem/12048621>. llvm-svn: 161523
* Comment parsing: add support for \tparam command on all levels.Dmitri Gribenko2012-07-311-1/+5
| | | | | | | | | | The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this breaks libclang binary compatibility, but should not be a problem since API is so new. This also fixes PR13372 as a side-effect. llvm-svn: 161087
* PR13365: Fix code which was trying to treat an array of DeducedTemplateArgumentRichard Smith2012-07-161-10/+7
| | | | | | | | as an array of its base class TemplateArgument. Switch the const TemplateArgument* parameters of InstantiatingTemplate's constructors to ArrayRef<TemplateArgument> to prevent this from happening again in the future. llvm-svn: 160245
* Apply visibility pragmas to class template declarations. This is needed becauseRafael Espindola2012-07-131-0/+2
| | | | | | we might use the declaration to build a type before seeing the definition. llvm-svn: 160176
* Fix a bug in my previous commit. The problem is not that we were not using theRafael Espindola2012-07-131-0/+3
| | | | | | | canonical decl for the template, but that we were not merging attributes for templates at all! llvm-svn: 160157
* PR9793: Treat substitution as an instantiation step for the purpose of theRichard Smith2012-07-081-0/+14
| | | | | | | | -ftemplate-depth limit. There are various ways to get an infinite (or merely huge) stack of substitutions with no intervening instantiations. This is also consistent with gcc's behavior. llvm-svn: 159907
* Documentation cleanup:James Dennett2012-06-151-5/+8
| | | | | | | | | * Escaped "::" and "<" as needed in Doxygen comments; * Marked up code examples with \code...\endcode; * Documented a \param that is current, instead of a few that aren't; * Fixed up some \file and \brief comments. llvm-svn: 158562
* Documentation cleanup:James Dennett2012-06-151-1/+1
| | | | | | | | | * Removed \param comments for parameters that no longer exist; * Fixed a "\para" typo to "\param"; * Escaped @, # and \ symbols as needed in Doxygen comments; * Added use of \brief to output short summaries. llvm-svn: 158498
* Still more Doxygen documentation fixes:James Dennett2012-06-141-1/+1
| | | | | | | | * Escape #, < and @ symbols where Doxygen would try to interpret them; * Fix several function param documentation where names had got out of sync; * Delete param documentation referring to parameters that no longer exist. llvm-svn: 158472
* Fix up the 'typename' suggestion logic introduced in r157085, based onKaelyn Uhrain2012-06-081-11/+9
| | | | | | feedback from Doug Gregor. llvm-svn: 158185
* Plug a long standing memory leak in TemplateArgument.Benjamin Kramer2012-06-071-5/+6
| | | | | | | | | | | | | | | The integral APSInt value is now stored in a decomposed form and the backing store for large values is allocated via the ASTContext. This way its not leaked as TemplateArguments are never destructed when they are allocated in the ASTContext. Since the integral data is immutable it is now shared between instances, making copying TemplateArguments a trivial operation. Currently getting the integral data out of a TemplateArgument requires creating a new APSInt object. This is cheap when the value is small but can be expensive if it's not. If this turns out to be an issue a more efficient accessor could be added. llvm-svn: 158150
* Suggest adding 'typename' when it would make the compilerKaelyn Uhrain2012-05-181-0/+39
| | | | | | accept the template argument expression as a type. llvm-svn: 157085
* A little tweak to the SFINAE condition reporting. Don't say:Richard Smith2012-05-091-1/+47
| | | | | | | | | | | | | | candidate template ignored: substitution failed [with T = int]: no type named 'type' in 'std::enable_if<false, void>' Instead, just say: candidate template ignored: disabled by 'enable_if' [with T = int] ... and point at the enable_if condition which (we assume) failed. This is applied to all cases where the user writes 'typename enable_if<...>::type' (optionally prefixed with a nested name specifier), and 'enable_if<...>' names a complete class type which does not have a member named 'type', and this results in a candidate function being ignored in a SFINAE context. Thus it catches 'std::enable_if', 'std::__1::enable_if', 'boost::enable_if' and 'llvm::enable_if'. llvm-svn: 156463
* Move Sema::VerifyIntegerConstantExpression() andDouglas Gregor2012-05-041-2/+14
| | | | | | | | Sema::ConvertToIntegralOrEnumerationType() from PartialDiagnostics to abstract "diagnoser" classes. Not much of a win here, but we're -several PartialDiagnostics. llvm-svn: 156217
* In C++11 mode, implement the C++11 semantics forDouglas Gregor2012-05-011-2/+4
| | | | | | | | | | | [basic.lookup.classref]p1 and p4, which concerns name lookup for nested-name-specifiers and template names, respectively, in a member access expression. C++98/03 forces us to look both in the scope of the object and in the current scope, then compare the results. C++11 just takes the result from the scope of the object, if something is found. Fixes <rdar://problem/11328502>. llvm-svn: 155935
* Add a missing ExpressionEvaluationContext for template default arguments. ↵Eli Friedman2012-04-261-0/+1
| | | | | | Fixes PR12581. llvm-svn: 155670
* Two missing -Wc++98-compat warnings, for null pointers as non-type templateRichard Smith2012-04-261-0/+3
| | | | | | arguments, and 'this' in exception-specifications. llvm-svn: 155606
* When resolving default template arguments, it should be done in the ↵Argyrios Kyrtzidis2012-04-251-0/+3
| | | | | | | | | | declaration context of the template what we are going to instantiate. Fixes various crashes of rdar://11242625 & http://llvm.org/PR11421. llvm-svn: 155576
* PR12585: When processing a friend template inside a class template, don'tRichard Smith2012-04-221-15/+12
| | | | | | | | pretend there was no previous declaration -- that can lead us to injecting a class template (with no access specifier) into a class scope. Instead, just avoid the problematic checks. llvm-svn: 155303
* When declaring a template, check that the context doesn't already contain aRichard Smith2012-04-211-3/+22
| | | | | | | declaration of the same name. r155187 caused us to miss this if the prior declaration did not declare a type. llvm-svn: 155269
* Replace r155185 with a better fix, which also addresses PR12557. When lookingRichard Smith2012-04-201-3/+3
| | | | | | | | | up an elaborated type specifier in a friend declaration, only look for type declarations, per [basic.lookup.elab]p2. If we know that the redeclaration lookup for a friend class template in a dependent context finds a non-template, don't delay the diagnostic to instantiation time. llvm-svn: 155187
* Fix a bug which creduce found reducing PR12585.Richard Smith2012-04-201-1/+1
| | | | llvm-svn: 155185
* Improve diagnostics in C++11 when a non-type template argument for aDouglas Gregor2012-04-101-2/+27
| | | | | | non-type template parameter of pointer type is not a constant expression. llvm-svn: 154424
* Rework implementation of null non-type template arguments based onDouglas Gregor2012-04-101-118/+154
| | | | | | | Richard's feedback, to properly catch non-constant expressions and type mismatches. Finishes <rdar://problem/11193097>. llvm-svn: 154407
* Implement support for null non-type template arguments for non-typeDouglas Gregor2012-04-061-21/+87
| | | | | | | template parameters of pointer, pointer-to-member, or nullptr_t type in C++11. Fixes PR9700 / <rdar://problem/11193097>. llvm-svn: 154219
* Implement C++11 [temp.arg.nontype]'s permission to use the address of an objectRichard Smith2012-04-041-34/+40
| | | | | | or function with internal linkage as a non-type template argument. llvm-svn: 154053
* If we encounter a friend class template for which we cannot resolveDouglas Gregor2012-03-301-2/+6
| | | | | | | | | | | | | the nested-name-specifier (e.g., because it is dependent), do not error even though we can't represent it in the AST at this point. This is a horrible, horrible hack. The actual feature we still need to implement (for C++98!) is covered by PR12292. However, we used to silently accept this code, so when we recently started rejecting it we caused some regressions (e.g., <rdar://problem/11147355>). This hack brings us back to the passable-but-not-good state we had previously. llvm-svn: 153752
* Unify and fix our checking of C++ [dcl.meaning]p1's requirementsDouglas Gregor2012-03-281-3/+2
| | | | | | | | | concerning qualified declarator-ids. We now diagnose extraneous qualification at namespace scope (which we had previously missed) and diagnose these qualification errors for all kinds of declarations; it was rather uneven before. Fixes <rdar://problem/11135644>. llvm-svn: 153577
* Support for definitions of member enumerations of class templates outside theRichard Smith2012-03-231-8/+26
| | | | | | | class template's definition, and for explicit specializations of such enum members. llvm-svn: 153304
* Replace a FIXME with a diagnostic when we can't resolve theDouglas Gregor2012-03-181-1/+2
| | | | | | nested-name-specifier for a class template declaration. Fixes PR12291. llvm-svn: 153006
* Diagnose tag and class template declarations with qualifiedDouglas Gregor2012-03-171-2/+4
| | | | | | declarator-ids that occur at class scope. Fixes PR8019. llvm-svn: 153002
OpenPOWER on IntegriCloud