summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Factor out common code for diagnosing missing template arguments.Richard Smith2018-04-261-3/+3
| | | | | | In passing, add 'concept' to the list of template kinds in diagnostics. llvm-svn: 330890
* Implement C++ DR727, which permits explicit specializations at class scope.Richard Smith2018-03-161-3/+2
| | | | | | | | | More generally, this permits a template to be specialized in any scope in which it could be defined, so this also supersedes DR44 and DR374 (the latter of which we previously only implemented in C++11 mode onwards due to unclarity as to whether it was a DR). llvm-svn: 327705
* When we see a '<' operator, check whether it's a probable typo for a ↵Richard Smith2017-05-101-4/+3
| | | | | | | | | | | | | | | | | | | template-id. The heuristic that we use here is: * the left-hand side must be a simple identifier or a class member access * the right-hand side must be '<' followed by either a '>' or by a type-id that cannot be an expression (in particular, not followed by '(' or '{') * there is a '>' token matching the '<' token The second condition guarantees the expression would otherwise be ill-formed. If we're confident that the user intended the name before the '<' to be interpreted as a template, diagnose the fact that we didn't interpret it that way, rather than diagnosing that the template arguments are not valid expressions. llvm-svn: 302615
* [c++1z] Require an initializer for deduced class template specialization types.Richard Smith2017-02-101-3/+3
| | | | | | | | It's actually meaningful and useful to allow such variables to have no initializer, but we are strictly following the standard here until the C++ committee reaches consensus on allowing this. llvm-svn: 294785
* Don't classify variable template names as type templates.Richard Smith2017-01-101-0/+5
| | | | llvm-svn: 291528
* DR259: Demote the pedantic error for an explicit instantiation after anRichard Smith2016-08-311-3/+3
| | | | | | | | | explicit specialization to a warning for C++98 mode (this is a defect report resolution, so per our informal policy it should apply in C++98), and turn the warning on by default for C++11 and later. In all cases where it fires, the right thing to do is to remove the pointless explicit instantiation. llvm-svn: 280308
* Fix crash while parsing variable template with variadic template argumentsOlivier Goffart2016-05-261-0/+6
| | | | | | | | | | It is only a crash if the compiler optimize for this!=nullptr because LocalInstantiationScope::getPartiallySubstitutedPack checks if 'this' is null (This is crashing when clang is compiled with GCC6) Differential Revision: http://reviews.llvm.org/D20511 llvm-svn: 270845
* Lit C++11 Compatibility Patch #8Charles Li2016-04-141-1/+1
| | | | | | 24 tests have been updated for C++11 compatibility. llvm-svn: 266387
* [modules] Rationalize the behavior of Decl::declarationReplaces, and inRichard Smith2015-11-031-2/+2
| | | | | | | | | particular don't assume that two declarations of the same kind in the same context are declaring the same entity. That's not true when the same name is declared multiple times as internal-linkage symbols within a module. (getCanonicalDecl is cheap now, so we can just use it here.) llvm-svn: 251898
* [Sema] Emit a better diagnostic when variable redeclarations disagreeDavid Majnemer2015-07-141-3/+3
| | | | | | | | | | | We referred to all declaration in definitions in our diagnostic messages which is can be inaccurate. Instead, classify the declaration and emit an appropriate diagnostic for the new declaration and an appropriate note pointing to the old one. This fixes PR24116. llvm-svn: 242190
* Tweak diagnostic wording for init list narrowingAlp Toker2014-05-171-1/+1
| | | | | | | | | The conventional form is '<action> to silence this warning'. Also call the diagnostic an 'issue' rather than a 'message' because the latter term is more widely used with reference to message expressions. llvm-svn: 209052
* Fix PR19169 [Crash on invalid attempting to specialize a template method as ↵Karthik Bhat2014-05-081-0/+10
| | | | | | | | | a template variable]. A template declaration of a template name can be null in case we have a dependent name or a set of function templates. Hence use dyn_cast_or_null instead of dyn_cast. Also improve the diagnostic emitted in this case. llvm-svn: 208313
* PR19152: If a variable template's type involves 'auto', instantiate theRichard Smith2014-03-161-0/+7
| | | | | | initializer with the variable in order to determine the type. llvm-svn: 204015
* PR18530: Don't assert when performing error recovery after a missing ↵Richard Smith2014-01-251-0/+5
| | | | | | 'template<>' on a variable template explicit specialization. llvm-svn: 200099
* Clean up variable template handling a bit, and correct the behavior of nameRichard Smith2014-01-161-8/+5
| | | | | | lookup when declaring a variable template specialization. llvm-svn: 199438
* Fix crash if a variable template specialization is used in a ↵Richard Smith2013-12-041-3/+2
| | | | | | nested-name-specifier. llvm-svn: 196335
* Fix several crash-on-invalids when using template-ids that aren'tRichard Smith2013-12-041-0/+8
| | | | | | simple-template-ids (eg, 'operator+<int>') in weird places. llvm-svn: 196333
* Implement restriction that a partial specialization must actually specializeRichard Smith2013-09-241-2/+1
| | | | | | something, for variable templates. llvm-svn: 191278
* Fix accepts-invalid if a variable template explicit instantiation is missing anRichard Smith2013-09-181-1/+4
| | | | | | argument list, but could be instantiated with argument list of <>. llvm-svn: 190913
* Refactor for clarity and simplicity.Larisse Voufo2013-08-221-22/+22
| | | | llvm-svn: 188974
* Bug fix: note diagnosis on expression narrowing should say "variable ↵Larisse Voufo2013-08-141-1/+10
| | | | | | template" instead of "static data member" when appropriate llvm-svn: 188409
* Bug fix: disallow a variable template to be redeclared as a non-templated ↵Larisse Voufo2013-08-141-1/+4
| | | | | | variable llvm-svn: 188350
* variable templates updated for PCH serialization... Still working on test ↵Larisse Voufo2013-08-131-0/+5
| | | | | | cases... llvm-svn: 188249
* Started implementing variable templates. Top level declarations should be ↵Larisse Voufo2013-08-061-0/+415
fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention... llvm-svn: 187762
OpenPOWER on IntegriCloud