summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/alias-template.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [c++20] Implement P0846R0: allow (ADL-only) calls to template-ids whoseRichard Smith2019-05-091-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | template name is not visible to unqualified lookup. In order to support this without a severe degradation in our ability to diagnose typos in template names, this change significantly restructures the way we handle template-id-shaped syntax for which lookup of the template name finds nothing. Instead of eagerly diagnosing an undeclared template name, we now form a placeholder template-name representing a name that is known to not find any templates. When the parser sees such a name, it attempts to disambiguate whether we have a less-than comparison or a template-id. Any diagnostics or typo-correction for the name are delayed until its point of use. The upshot should be a small improvement of our diagostic quality overall: we now take more syntactic context into account when trying to resolve an undeclared identifier on the left hand side of a '<'. In fact, this works well enough that the backwards-compatible portion (for an undeclared identifier rather than a lookup that finds functions but no function templates) is enabled in all language modes. llvm-svn: 360308
* [SemaCXX] Fix ICE for unexpanded parameter packBrian Gesiak2019-01-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The documentation for RecursiveASTVisitor::TraverseDecl states that the Decl being traversed may be null. In fact, this is the case when a CXXCatchStmt with no exception decl is traversed. Because the visitor for diagnosing unexpanded parameter packs does not check for null, it ends up crashing when it attempts to call the Decl::isParameterPack method on a null Decl pointer. Add a null check to prevent an ICE, and a test case that would crash otherwise. Also, because the test requires C++ exceptions and C++14, change the test parameters for the entire test file. (Alternatively, I thought about adding a new test file, but went with this approach for my own convenience.) Co-authored-by: Andreas Molzer <andreas.molzer@gmx.de> Co-authored-by: Mara Bos <m-ou.se@m-ou.se> Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56271 llvm-svn: 350501
* [Sema] Make sure we substitute an instantiation-dependent default template ↵Erik Pilkington2018-11-121-0/+10
| | | | | | | | | | argument Fixes llvm.org/PR39623 Differential revision: https://reviews.llvm.org/D54414 llvm-svn: 346709
* Push alias-declarations and alias-template declarations into scope even ifRichard Smith2016-07-151-2/+2
| | | | | | | | they're redeclarations. This is necessary in order for name lookup to correctly find the most recent declaration of the name (which affects default template argument lookup and cross-module merging, among other things). llvm-svn: 275612
* [AST] Perform additional canonicalization for DependentSizedArrayTypeDavid Majnemer2015-07-241-0/+11
| | | | | | | | | | We treated DependentSizedArrayTypes with the same element type but differing size expressions as equivalently canonical. This would lead to bizarre behavior during template instantiation. This fixes PR24212. llvm-svn: 243093
* DR1909: Diagnose all invalid cases of a class member sharing its name with ↵Richard Smith2015-07-061-4/+2
| | | | | | the class. llvm-svn: 241425
* Replace "can not" with "cannot" in diagnostics messages.Ismail Pazarbasi2014-03-071-4/+4
| | | | llvm-svn: 203302
* Implement DR577David Majnemer2014-02-191-1/+1
| | | | | | | | DR18 previously forebode typedefs to be used as parameter types if they were of type 'void'. DR577 allows 'void' to be used as a function parameter type regardless from where it came. llvm-svn: 201631
* Fixed an assertion failure triggered by invalid code.Enea Zaffanella2013-01-111-3/+1
| | | | | | | | Set invalid type of declarator after emitting error diagnostics, so that it won't be later considered when instantiating the template. Added test5_inst in test/SemaCXX/condition.cpp for non-regression. llvm-svn: 172201
* PR12647: An alias template instantiation which occurs in a SFINAE context isRichard Smith2012-04-261-0/+27
| | | | | | itself a SFINAE context. llvm-svn: 155621
* Fix parsing of type-specifier-seq's. Types are syntactically allowed to beRichard Smith2012-03-121-2/+3
| | | | | | | | | | | | | | | | | | defined here, but not semantically, so new struct S {}; is always ill-formed, even if there is a struct S in scope. We also had a couple of bugs in ParseOptionalTypeSpecifier caused by it being under-loved (due to it only being used in a few places) so merge it into ParseDeclarationSpecifiers with a new DeclSpecContext. To avoid regressing, this required improving ParseDeclarationSpecifiers' diagnostics in some cases. This also required teaching ParseSpecifierQualifierList about constexpr... which incidentally fixes an issue where we'd allow the constexpr specifier in other bad places. llvm-svn: 152549
* PR11684, core issue 1417:Richard Smith2012-02-101-2/+1
| | | | | | | | | | | | | | o Correct the handling of the restrictions on usage of cv-qualified and ref-qualified function types. o Fix a bug where such types were rejected in template type parameter default arguments, due to such arguments not being treated as a template type arg context. o Remove the ExtWarn for usage of such types as template arguments; that was a standard defect, not a GCC extension. o Improve the wording and unify the code for diagnosing cv-qualifiers with the code for diagnosing ref-qualifiers. llvm-svn: 150244
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-131-1/+1
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Implement support for C++0x alias templates.Richard Smith2011-05-051-0/+147
llvm-svn: 130953
OpenPOWER on IntegriCloud