summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/nested-name-spec-template.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Improve diagnostics and error recovery for template name lookup.Richard Smith2018-05-111-3/+3
| | | | | | | | | | | | | 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
* [Lit Test] Updated 20 Lit tests to be C++11 compatible.Charles Li2015-12-101-2/+11
| | | | | | | | This is the 5th Lit test patch. Expanded expected diagnostics to vary by C++ dialect. Expanded RUN line to: default, C++98/03 and C++11. llvm-svn: 255196
* Don't ask if a depenendent CXXRecordDecl has any dependent basesDouglas Gregor2011-03-111-0/+13
| | | | | | | unless we already know that it has a definition. Fixes PR9449/<rdar://problem/9115785>. llvm-svn: 127512
* Teach Sema::ActOnCXXNestedNameSpecifier and Sema::CheckTemplateIdTypeDouglas Gregor2011-03-041-0/+28
| | | | | | | | to cope with non-type templates by providing appropriate errors. Previously, we would either assert, crash, or silently build a dependent type when we shouldn't. Fixes PR9226. llvm-svn: 127037
* When a nested-name-specifier refers into a current instantiation that hasDouglas Gregor2010-07-281-0/+11
| | | | | | | | dependent bases, construct a dependent nested-name-specifier rather than complaining that the name could not be found within the current instantiation itself. Fixes PR7725. llvm-svn: 109582
* When pushing a copy of the TypeLoc information for a dependentDouglas Gregor2010-06-171-0/+16
| | | | | | | template specialization type, copy the location information but use the new type. Fixes PR7385. llvm-svn: 106224
* When we see a 'template' disambiguator that marks the next identifierDouglas Gregor2010-06-161-0/+1
| | | | | | | | | | | (or operator-function-id) as a template, but the context is actually non-dependent or the current instantiation, allow us to use knowledge of what kind of template it is, e.g., type template vs. function template, for further syntactic disambiguation. This allows us to parse properly in the presence of stray "template" keywords, which is necessary in C++0x and it's good recovery in C++98/03. llvm-svn: 106167
* Fix the recently-added warning about 'typename' and 'template'Douglas Gregor2010-06-161-1/+1
| | | | | | | | | 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-1/+1
| | | | | | | non-dependent type or template name, respectively, in C++98/03. Fixes PR7111 and <rdar://problem/8002682>. llvm-svn: 105968
* Make sure to search semantic scopes and appropriate template-parameterDouglas Gregor2010-05-141-0/+7
| | | | | | | scopes during unqualified name lookup that has fallen out to namespace scope. Fixes PR7133. llvm-svn: 103766
* Rebuild the nested name specifiers in member-pointer declarator chunks whenJohn McCall2010-04-291-0/+13
| | | | | | | | | entering the current instantiation. Set up a little to preserve type location information for typename types while we're in there. Fixes a Boost failure. llvm-svn: 102673
* Fix an assertion-on-error during tentative constructor parsing byJohn McCall2010-02-261-1/+0
| | | | | | | | | | propagating error conditions out of the various annotate-me-a-snowflake routines. Generally (but not universally) removes redundant diagnostics as well as, you know, not crashing on bad code. On the other hand, I have just signed myself up to fix fiddly parser errors for the next week. Again. llvm-svn: 97221
* 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
* Remove unnecessary -fms-extensions=0 from tests (this command line syntax is ↵Daniel Dunbar2009-11-291-1/+1
| | | | | | going away). llvm-svn: 90066
* Fix speculative parsing of dependent template names inDouglas Gregor2009-11-111-12/+5
| | | | | | | | | | | | | | | | | | | | | | nested-name-specifiers so that they don't gobble the template name (or operator-function-id) unless there is also a template-argument-list. For example, given T::template apply we would previously consume both "template" and "apply" as part of parsing the nested-name-specifier, then error when we see that there is no "<" starting a template argument list. Now, we parse such constructs tentatively, and back off if the "<" is not present. This allows us to parse dependent template names as one would use them for, e.g., template template parameters: template<typename T, template<class> class X = T::template apply> struct MetaSomething; Also, test default arguments for template template parameters. llvm-svn: 86841
* Disabling some MS extensions which cause these tests to failJohn Thompson2009-10-271-1/+1
| | | | llvm-svn: 85236
* Make the implicit-int handling error recovery stuff handle C++Chris Lattner2009-04-141-3/+2
| | | | | | | | | | | | | | | | | | | nested name specifiers. Now we emit stuff like: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~ ^ instead of: t.cpp:8:16: error: invalid token after top level declarator static foo::X P; ^ This is inspired by a really awful error message I got from g++ when I misspelt diag::kind as diag::Kind. llvm-svn: 69086
* Make parsing a semantic analysis a little more robust following SemaDouglas Gregor2009-04-011-1/+1
| | | | | | | | | | | | | | | | failures that involve malformed types, e.g., "typename X::foo" where "foo" isn't a type, or "std::vector<void>" that doens't instantiate properly. Similarly, be a bit smarter in our handling of ambiguities that occur in Sema::getTypeName, to eliminate duplicate error messages about ambiguous name lookup. This eliminates two XFAILs in test/SemaCXX, one of which was crying out to us, trying to tell us that we were producing repeated error messages. llvm-svn: 68251
* Parsing and AST representation for dependent template names that occurDouglas Gregor2009-03-311-0/+13
| | | | | | | | | | | within nested-name-specifiers, e.g., for the "apply" in typename MetaFun::template apply<T1, T2>::type At present, we can't instantiate these nested-name-specifiers, so our testing is sketchy. llvm-svn: 68081
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Fix various problems with matching out-of-line definitions of staticDouglas Gregor2009-03-111-2/+1
| | | | | | | | | class members to the corresponding in-class declaration. Diagnose the erroneous use of 'static' on out-of-line definitions of class members. llvm-svn: 66740
* Implement parsing of nested-name-specifiers that involve template-ids, e.g.,Douglas Gregor2009-02-251-0/+50
std::vector<int>::allocator_type When we parse a template-id that names a type, it will become either a template-id annotation (which is a parsed representation of a template-id that has not yet been through semantic analysis) or a typename annotation (where semantic analysis has resolved the template-id to an actual type), depending on the context. We only produce a type in contexts where we know that we only need type information, e.g., in a type specifier. Otherwise, we create a template-id annotation that can later be "upgraded" by transforming it into a typename annotation when the parser needs a type. This occurs, for example, when we've parsed "std::vector<int>" above and then see the '::' after it. However, it means that when writing something like this: template<> class Outer::Inner<int> { ... }; We have two tokens to represent Outer::Inner<int>: one token for the nested name specifier Outer::, and one template-id annotation token for Inner<int>, which will be passed to semantic analysis to define the class template specialization. Most of the churn in the template tests in this patch come from an improvement in our error recovery from ill-formed template-ids. llvm-svn: 65467
OpenPOWER on IntegriCloud