summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/template-id-expr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Improve diagnostics and error recovery for template name lookup.Richard Smith2018-05-111-3/+32
| | | | | | | | | | | | | For 'x::template y', consistently give a "no member named 'y' in 'x'" diagnostic if there is no such member, and give a 'template keyword not followed by a template' name error if there is such a member but it's not a template. In the latter case, add a note pointing at the non-template. Don't suggest inserting a 'template' keyword in 'X::Y<' if X is dependent if the lookup of X::Y was actually not a dependent lookup and found only non-templates. llvm-svn: 332076
* Parse A::template B as an identifier rather than as a template-id with noRichard Smith2018-04-271-0/+46
| | | | | | | | | | template arguments. This fixes some cases where we'd incorrectly accept "A::template B" when B is a kind of template that requires template arguments (in particular, a variable template or a concept). llvm-svn: 331013
* Recently a change was made to this test in r294639 which fails when theDouglas Yung2017-02-241-1/+6
| | | | | | | | | | | compiler is run in a mode where the default C++ standard is newer than C++03. The reason is because one of the warnings checked is only produced when the compiler is using C++03 or lower. This change fixes this problem as well as adds explicit run lines to run the test in C++03 and C++11 modes. llvm-svn: 296066
* Diagnose attempts to explicitly instantiate a template at class scope. ↵Richard Smith2017-02-091-2/+6
| | | | | | Previously Clang would simply ignore the 'template' keyword in this case. llvm-svn: 294639
* Improve error message when referencing a non-tag type with a tagReid Kleckner2016-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | Other compilers accept invalid code here that we reject, and we need a better error message to try to convince users that the code is really incorrect. Consider: class Foo { typedef MyIterHelper<Foo> iterator; friend class iterator; }; Previously our wording was "elaborated type refers to a typedef". "elaborated type" isn't widely known terminology, so the new diagnostic says "typedef 'iterator' cannot be referenced with class specifier". Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D25216 llvm-svn: 289259
* Fix a crash on invalid with template handlingRichard Trieu2016-04-051-0/+6
| | | | | | | | This is a fix for https://llvm.org/bugs/show_bug.cgi?id=25561 which was a crash on invalid. Change the handling of invalid decls to have a catch-all case to prevent unexpecting decls from triggering an assertion. llvm-svn: 265467
* Fixed instantiation of DependentScopeDeclRefExpr.Abramo Bagnara2012-02-061-0/+14
| | | | llvm-svn: 149868
* Fix the recently-added warning about 'typename' and 'template'Douglas Gregor2010-06-161-6/+5
| | | | | | | | | disambiguation keywords outside of templates in C++98/03. Previously, the warning would fire when the associated nested-name-specifier was not dependent, but that was a misreading of the C++98/03 standard: now, we complain only when we're outside of any template. llvm-svn: 106161
* Warn when a 'typename' or a 'template' keyword refers to aDouglas Gregor2010-06-141-5/+6
| | | | | | | non-dependent type or template name, respectively, in C++98/03. Fixes PR7111 and <rdar://problem/8002682>. llvm-svn: 105968
* Support for 'template' as a disambiguator (PR7030)Douglas Gregor2010-05-051-0/+38
| | | | | | | | | | | | | ParseOptionalCXXScopeSpecifier() only annotates the subset of template-ids which are not subject to lexical ambiguity. Add support for the more general case in ParseUnqualifiedId() to handle cases such as A::template B(). Also improve some diagnostic locations. Fixes PR7030, from Alp Toker! llvm-svn: 103081
* When we're parsing an expression that may have looked like aDouglas Gregor2010-02-051-0/+17
| | | | | | | | | declaration, we can end up with template-id annotation tokens for types that have not been converted into type annotation tokens. When this is the case, translate the template-id into a type and parse as an expression. llvm-svn: 95404
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - 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
* When instantiating a MemberExpr, be sure to instantiate theDouglas Gregor2009-11-041-1/+16
| | | | | | explicitly-specified template arguments, too! llvm-svn: 86066
* Yet more instantiation-location information. Fixes PR5336.Douglas Gregor2009-10-291-0/+14
llvm-svn: 85516
OpenPOWER on IntegriCloud