summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH/cxx-templates.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bug in the property-based serialization ofJohn McCall2019-12-161-0/+10
| | | | | | | | | dependent template names. Apparently we didn't test this in the test suite because we have a lot of redundant ways of representing this situation that kick in in the more common situations. For example, DependentTST stores a qualifier + identifier pair rather than a TemplateName.
* Convert MemberExpr creation and serialization to work the same way asRichard Smith2019-06-061-0/+9
| | | | | | | | | | most / all other Expr subclasses. This reinstates r362551, reverted in r362597, with a fix to a bug that caused MemberExprs to sometimes have a null FoundDecl after a round-trip through an AST file. llvm-svn: 362756
* CWG issue 727: Fix numerous bugs in support for class-scope explicitRichard Smith2019-05-031-16/+18
| | | | | | specializations for variable templates. llvm-svn: 359947
* Replace ad-hoc tracking of pattern for an instantiated class-scopeRichard Smith2019-05-021-4/+26
| | | | | | | | | | explicit function specialization with the MemberSpecializationInfo used everywhere else. Not NFC: the ad-hoc pattern tracking was not being serialized / deserialized properly. That's fixed here. llvm-svn: 359747
* [serialization] PR34728: Don't assume that only a suffix of templateRichard Smith2018-07-311-0/+16
| | | | | | | | | | | | | parameters can have default arguments. At least for function templates and class template partial specializations, it's possible for a template parameter with a default argument to be followed by a non-pack template parameter with no default argument, and this case was not properly handled here. Testcase by Steve O'Brien! llvm-svn: 338438
* Don't mark a member as a member specialization until we know we're keeping ↵Richard Smith2017-05-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | the specialization. This improves our behavior in a few ways: * We now guarantee that if a member is marked as being a member specialization, there will actually be a member specialization declaration somewhere on its redeclaration chain. This fixes a crash in modules builds where we would try to check that there was a visible declaration of the member specialization and be surprised to not find any declaration of it at all. * We don't set the source location of the in-class declaration of the member specialization to the out-of-line declaration's location until we have actually finished merging them. This fixes some very silly looking diagnostics, where we'd point a "previous declaration is here" note at the same declaration we're complaining about. Ideally we wouldn't mess with the prior declaration's location at all, but too much code assumes that the first declaration of an entity is a reasonable thing to use as an indication of where it was declared, and that's not really true for a member specialization unless we fake it like this. llvm-svn: 302596
* [PCH/Modules] Check that the specific module cache path the PCH was built ↵Argyrios Kyrtzidis2015-02-191-1/+1
| | | | | | | | | | | | with, is the same as the one in the current compiler invocation. If they differ reject the PCH. This protects against the badness occurring from getting modules loaded from different module caches (see crashes). rdar://19889860 llvm-svn: 229909
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-141-11/+11
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* Update tests in preparation for using the MS ABI for Win32 targetsHans Wennborg2014-01-131-11/+11
| | | | | | | | | | In preparation for making the Win32 triple imply MS ABI mode, make all tests pass in this mode, or make them use the Itanium mode explicitly. Differential Revision: http://llvm-reviews.chandlerc.com/D2401 llvm-svn: 199130
* Switch to the new MingW ABI.Rafael Espindola2013-12-121-2/+2
| | | | | | | GCC 4.7 changed the MingW ABI. On the clang side this means that methods now have the thiscall calling convention by default. llvm-svn: 197164
* Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:Richard Smith2013-08-131-6/+10
| | | | | | | | | | | | | When a local extern declaration redeclares some other entity, the type of that entity is merged with the prior type if the prior declaration is visible (in C) or is declared in the same scope (in C++). - Make LookupRedeclarationWithLinkage actually work in C++, use it in the right set of cases, and make it track whether it found a shadowed declaration. - Track whether we found a declaration in the same scope (for C++) including across serialization and template instantiation. llvm-svn: 188307
* PR9992: Serialize and deserialize the token sequence for a function template inRichard Smith2013-08-071-0/+5
| | | | | | -fdelayed-template-parsing mode. Patch by Will Wilson! llvm-svn: 187916
* C++ modules: Don't call DeclContext::lookup when half-way through deserializingRichard Smith2013-07-131-0/+5
| | | | | | | decls. That can reenter deserialization and explode horribly by trying to merge a declaration that we've not got very far through deserializing yet. llvm-svn: 186236
* Lazily deserialize function template specializations. This fixes a cycle inRichard Smith2013-06-281-0/+5
| | | | | | module deserialization / merging, and more laziness here is general goodness. llvm-svn: 185132
* Add test coverage for serialization of dependent function template ↵Eli Friedman2013-06-191-0/+4
| | | | | | specializations. llvm-svn: 184275
* Don't eagerly deserialize every templated function (and every static dataRichard Smith2013-04-011-1/+1
| | | | | | member inside a class template) when loading a PCH file or module. llvm-svn: 178496
* [PCH] Deserializing the DeclContext of a template parameter is not safeArgyrios Kyrtzidis2013-02-161-0/+6
| | | | | | | | | | | until recursive loading is finished. Otherwise we may end up with a template trying to deserialize a template parameter that is in the process of getting loaded. rdar://13135282 llvm-svn: 175329
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-191-0/+2
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* PR13811: Add a FunctionParmPackExpr node to handle references to functionRichard Smith2012-09-121-5/+14
| | | | | | | parameter packs where the reference is not being expanded but the pack has been. Previously, Clang would segfault in such cases. llvm-svn: 163672
* Canonicalize the declaration we write to a PCH file for anDouglas Gregor2012-03-261-0/+6
| | | | | | | | InjectedClassNameType; otherwise, it won't be properly wired to the original (canonical) declaration when it is deserialized. Fixes <rdar://problem/11112464>. llvm-svn: 153442
* When serializing a DeclRefExpr, always store the number of explicit templateAnders Carlsson2011-03-061-0/+19
| | | | | | | | arguments at the same offset, since it's needed when creating the empty DeclRefExpr when deserializing. Fixes a memory corruption issue that would lead to random bugs and crashes. llvm-svn: 127125
* Add -fcxx-exceptions to all tests that use C++ exceptions.Anders Carlsson2011-02-281-5/+5
| | | | llvm-svn: 126599
* Pass -fexceptions to all tests that use try/catch/throw.Anders Carlsson2011-02-191-5/+5
| | | | llvm-svn: 126037
* Implement proper (de-)serialization for explicit template argumentDouglas Gregor2011-02-041-0/+4
| | | | | | | lists with zero template arguments. Fixes some seriously scary crashers in C++ PCH. llvm-svn: 124862
* Make the deserialization of C++ base class specifiers lazy, improvingDouglas Gregor2010-10-291-0/+2
| | | | | | the performance of C++ PCH and reducing stack depth in the reader. llvm-svn: 117732
* When de-serializing a type that is supposed to be canonical, callDouglas Gregor2010-10-261-1/+3
| | | | | | | | | | | | | getCanonicalType() to make sure that the type we got back is actually canonical. This is the case for most types, which always build a canonical type when given canonical components. However, some types that involve expressions in their canonicalization (e.g., array types with dependent sizes) don't always build canonical types from canonical components, because there is no such thing as a "canonical" expression. Therefore, we do this extra mapping to ensure that the canonical types we store are actually canonical. llvm-svn: 117344
* Fix a C++ PCH problem which was exposed by r113019. ↵Argyrios Kyrtzidis2010-09-061-0/+2
| | | | | | CXXBaseOrMemberInitializer's IsWritten and source order is not set. llvm-svn: 113161
* tests: Avoid unnecessary redirection.Daniel Dunbar2010-08-101-2/+2
| | | | llvm-svn: 110709
* Store the pending implicit instantiations in the PCH and perform them at the ↵Argyrios Kyrtzidis2010-08-051-0/+3
| | | | | | | | end of the translation unit that included the PCH, as God intended. llvm-svn: 110324
* Apart from storing/retrieving the previous redeclaration from PCH, also ↵Argyrios Kyrtzidis2010-08-031-2/+9
| | | | | | | | | | | | store/retrieve the most recent redeclaration. That way we are sure that the full redeclarations chain is loaded. When using chained PCHs, first declarations point to the most recent redeclarations in the same PCH. To address this use a REDECLS_UPDATE_LATEST record block to keep track of which first declarations need to point to a most recent redeclaration in another PCH. llvm-svn: 110125
* Support NonTypeTemplateParmDecl for PCH.Argyrios Kyrtzidis2010-06-251-1/+1
| | | | llvm-svn: 106860
* Support a couple more C++ Exprs for PCH.Argyrios Kyrtzidis2010-06-241-2/+13
| | | | llvm-svn: 106727
* Support C++ class template specializations and partial specializations for PCH.Argyrios Kyrtzidis2010-06-231-3/+9
| | | | llvm-svn: 106625
* Support emitting/reading function templates to/from PCH.Argyrios Kyrtzidis2010-06-221-0/+4
| | | | llvm-svn: 106534
* Include a hack to allow loading of templated CXXRecordDecls and test ↵Argyrios Kyrtzidis2010-06-191-1/+2
| | | | | | template reading from PCH. llvm-svn: 106393
* Initial support for writing templates to PCH.Argyrios Kyrtzidis2010-06-191-0/+3
llvm-svn: 106391
OpenPOWER on IntegriCloud