summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp/temp.decls
Commit message (Collapse)AuthorAgeFilesLines
* Warn if function or variable cannot be implicitly instantiatedSerge Pavlov2016-04-191-0/+1
| | | | | | | | | | | | With this patch compiler emits warning if it tries to make implicit instantiation of a template but cannot find the template definition. The warning can be suppressed by explicit instantiation declaration or by command line options -Wundefined-var-template and -Wundefined-func-template. The implementation follows the discussion of http://reviews.llvm.org/D12326. Differential Revision: http://reviews.llvm.org/D16396 llvm-svn: 266719
* Diagnose template alias declarations in local classes.Richard Smith2016-04-061-1/+3
| | | | | | Patch by Erik Pilkington! llvm-svn: 265571
* [Lit Test] Updated 34 Lit tests to be C++11 compatible.Charles Li2015-11-172-0/+10
| | | | | | | Added expected diagnostics new to C++11. Expanded RUN line to: default, C++98/03 and C++11. llvm-svn: 253371
* PR20073: promote "dereference of 'void*'" from Extension to ExtWarn.Richard Smith2015-05-191-1/+1
| | | | llvm-svn: 237652
* Improve the error message for assigning to read-only variables.Richard Trieu2015-04-111-2/+2
| | | | | | | | | | Previously, many error messages would simply be "read-only variable is not assignable" This change provides more information about why the variable is not assignable, as well as note to where the const is located. Differential Revision: http://reviews.llvm.org/D4479 llvm-svn: 234677
* PR22435: Correctly implement tiebreaker for reference ordering in functionRichard Smith2015-02-201-1/+22
| | | | | | | template partial ordering rules. This rule applies per pair of types being compared, not per pair of function templates being compared. llvm-svn: 229965
* PR21531: fix crash on invalid with unexpanded pack in case value.Richard Smith2014-11-201-0/+1
| | | | llvm-svn: 222400
* Towards PR21289: don't lose track of unexpanded parameter packs withRichard Smith2014-10-171-0/+14
| | | | | | | non-dependent types, in CXXScalarValueInitExprs and in the nested-name-specifier or template arguments of a DeclRefExpr in particular. llvm-svn: 220028
* Fix "unsupported friend" diagnostic to also appear for friend functions with ↵Richard Smith2014-09-291-4/+4
| | | | | | dependent scopes. llvm-svn: 218590
* C++1y is now C++14!Aaron Ballman2014-08-191-4/+4
| | | | | | Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording. llvm-svn: 215982
* Reject varargs '...' in function prototype if there are more parameters afterRichard Smith2014-08-111-1/+1
| | | | | | | | | | | it. Diagnose with recovery if it appears after a function parameter that was obviously supposed to be a parameter pack. Otherwise, warn if it immediately follows a function parameter pack, because the user most likely didn't intend to write a parameter pack followed by a C-style varargs ellipsis. This warning can be syntactically disabled by using ", ..." instead of "...". llvm-svn: 215408
* Move DR532 test where it belongs.Nikola Smiljanic2014-06-031-16/+0
| | | | llvm-svn: 210064
* PR12961 - Extend DR532 to cover C++98/03.Nikola Smiljanic2014-05-312-63/+37
| | | | llvm-svn: 209955
* Replace "can not" with "cannot" in diagnostics messages.Ismail Pazarbasi2014-03-072-3/+3
| | | | llvm-svn: 203302
* PR18401: Fix assert by implementing the current proposed direction of coreRichard Smith2014-01-091-3/+12
| | | | | | | issue 1430. Don't allow a pack expansion to be used as an argument to an alias template unless the corresponding parameter is a parameter pack. llvm-svn: 198833
* Eliminate UnaryTypeTraitExprAlp Toker2014-01-011-1/+1
| | | | | | | | | | | | | Remove UnaryTypeTraitExpr and switch all remaining type trait related handling over to TypeTraitExpr. The UTT/BTT/TT enum prefix and evaluation code is retained pending further cleanup. This is part of the ongoing work to unify type traits following the removal of BinaryTypeTraitExpr in r197273. llvm-svn: 198271
* Eliminate BinaryTypeTraitExprAlp Toker2013-12-131-1/+1
| | | | | | | | | | | | | | | | | There's nothing special about type traits accepting two arguments. This commit eliminates BinaryTypeTraitExpr and switches all related handling over to TypeTraitExpr. Also fixes a CodeGen failure with variadic type traits appearing in a non-constant expression. The BTT/TT prefix and evaluation code is retained as-is for now but will soon be further cleaned up. This is part of the ongoing work to unify type traits. llvm-svn: 197273
* Issue a diagnostic if we see a templated friend declaration that we do notRichard Smith2013-11-081-3/+3
| | | | | | support. llvm-svn: 194273
* Sema: Do not allow template declarations inside local classesDavid Majnemer2013-10-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Enforce the rule in C++11 [temp.mem]p2 that local classes cannot have member templates. This fixes PR16947. N.B. C++14 has slightly different wording to afford generic lambdas declared inside of functions. Fun fact: Some formulations of local classes with member templates would cause clang to crash during Itanium mangling, such as the following: void outer_mem() { struct Inner { template <typename = void> struct InnerTemplateClass { static void itc_mem() {} }; }; Inner::InnerTemplateClass<>::itc_mem(); } Reviewers: eli.friedman, rsmith, doug.gregor, faisalv Reviewed By: doug.gregor CC: cfe-commits, ygao Differential Revision: http://llvm-reviews.chandlerc.com/D1866 llvm-svn: 193144
* Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.Kaelyn Uhrain2013-10-191-3/+3
| | | | | | | | | | | Now that CorrectTypo knows how to correctly search classes for typo correction candidates, there is no good reason to only replace an existing CXXScopeSpecifier if it refers to a namespace. While the actual enablement was a matter of changing a single comparison, the fallout from enabling the functionality required a lot more code changes (including my two previous commits). llvm-svn: 193020
* Hopefully unbreak bots which are seeing an assert in this test. Temporary, realRichard Smith2013-09-241-1/+7
| | | | | | | fix to come once I've tracked down the problem (which is pre-existing and not related to the change which introduced this test). llvm-svn: 191279
* Implement restriction that a partial specialization must actually specializeRichard Smith2013-09-241-0/+29
| | | | | | something, for variable templates. llvm-svn: 191278
* PR17075: When performing partial ordering of a member function against aRichard Smith2013-09-111-0/+7
| | | | | | | | | | | non-member function, the number of arguments in the two candidate calls will be different (the non-member call will have one extra argument). We used to get confused by this, and fail to compare the last argument when testing whether the member is better, resulting in us always thinking it is, even if the non-member is more specialized in the last argument. llvm-svn: 190470
* Started implementing variable templates. Top level declarations should be ↵Larisse Voufo2013-08-061-1/+1
| | | | | | 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
* Regression test for PR12699Serge Pavlov2013-08-051-0/+26
| | | | llvm-svn: 187734
* Reinstate r186040, with additional fixes and more test coverage (reverted inRichard Smith2013-07-171-0/+17
| | | | | | | | | | | | | r186331). Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186546
* Re-revert r86040, which was un-reverted in r186199.Chandler Carruth2013-07-151-17/+0
| | | | | | | | | | | | | | | This breaks the build of basic patterns with repeated friend declarations. See the added test case in SemaCXX/friend.cpp or the test case reported to the original commit log. Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186331
* Fix to PR12262 - assertion when substituting explicit template argumentsSerge Pavlov2013-07-151-0/+177
| | | | | | | | does not substitute a sizeof-pack expression. The solution is proposed by Richard Smith. Differential Revision: http://llvm-reviews.chandlerc.com/D869 llvm-svn: 186306
* Correctly classify pack expansions as NON_CANONICAL_UNLESS_DEPENDENTDavid Blaikie2013-07-131-0/+4
| | | | | | | | | | | Test coverage for non-dependent pack expansions doesn't demonstrate a failure prior to this patch (a follow-up commit improving debug info will cover this commit specifically) but covers a related hole in our test coverage. Reviewed by Richard Smith & Eli Friedman. llvm-svn: 186261
* Unrevert r186040, reverted in r186185, with fix for PR16597.Richard Smith2013-07-121-0/+17
| | | | | | | | | | | Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186199
* Revert r186040 to fix PR16597 while Richard investigates what the bestChandler Carruth2013-07-121-17/+0
| | | | | | | | | | | | | fix is. Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186185
* If we friend a declaration twice, that should not make it visible to nameRichard Smith2013-07-101-0/+17
| | | | | | | | | lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186040
* Missing test update from r184884.Richard Smith2013-06-251-1/+1
| | | | llvm-svn: 184885
* DebugInfo: Support (using GNU extensions) for template template parameters ↵David Blaikie2013-06-221-1/+1
| | | | | | and parameter packs llvm-svn: 184644
* Add a couple more tests.Eli Friedman2013-06-201-0/+1
| | | | llvm-svn: 184501
* Include the unexpanded packs in the initializer expression when checking aNick Lewycky2013-06-131-0/+11
| | | | | | pack expanded constructor initializer list. Fixes PR16303! llvm-svn: 183878
* The 'constexpr implies const' rule for non-static member functions is gone inRichard Smith2013-04-211-5/+5
| | | | | | | | | C++1y, so stop adding the 'const' there. Provide a compatibility warning for code relying on this in C++11, with a fix-it hint. Update our lazily-written tests to add the const, except for those ones which were testing our implementation of this rule. llvm-svn: 179969
* Refactor to call ActOnFinishFullExpr on every full expression. TeachRichard Smith2013-01-142-0/+18
| | | | | | | | ActOnFinishFullExpr that some of its checks only apply to discarded-value expressions. This adds missing checks for unexpanded variadic template parameter packs to a handful of constructs. llvm-svn: 172485
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-1918-0/+18
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* Fix a small FIXME involving template partial ordering andEli Friedman2012-09-191-0/+15
| | | | | | member function templates with an rvalue ref qualifier. llvm-svn: 164267
* Fix function template partial ordering rules for static vs. non-staticEli Friedman2012-09-192-0/+24
| | | | | | functions. llvm-svn: 164263
* PR13811: Add a FunctionParmPackExpr node to handle references to functionRichard Smith2012-09-121-0/+24
| | | | | | | parameter packs where the reference is not being expanded but the pack has been. Previously, Clang would segfault in such cases. llvm-svn: 163672
* Check access to friend declarations. There's a number of differentJohn McCall2012-08-101-0/+3
| | | | | | | | | | | | | | things going on here that were problematic: - We were missing the actual access check, or rather, it was suppressed on account of being a redeclaration lookup. - The access check would naturally happen during delay, which isn't appropriate in this case. - We weren't actually emitting dependent diagnostics associated with class templates, which was unfortunate. - Access was being propagated incorrectly for friend method declarations that couldn't be matched at parse-time. llvm-svn: 161652
* PR13386: When matching up parameters between a function template declarationRichard Smith2012-07-181-0/+43
| | | | | | | | | | | and a function template instantiation, if there's a parameter pack in the declaration and one at the same place in the instantiation, don't assume that the pack wasn't expanded -- it may have expanded to nothing. Instead, go ahead and check whether the parameter pack was expandable. We can do this as a side-effect of the work we'd need to do anyway, to find how many parameters were produced. llvm-svn: 160416
* Implement the last part of C++ [class.mem]p2, delaying the parsing ofDouglas Gregor2012-04-161-1/+1
| | | | | | | | | exception specifications on member functions until after the closing '}' for the containing class. This allows, for example, a member function to throw an instance of its own class. Fixes PR12564 and a fairly embarassing oversight in our C++98/03 support. llvm-svn: 154844
* Support for definitions of member enumerations of class templates outside theRichard Smith2012-03-231-0/+152
| | | | | | | class template's definition, and for explicit specializations of such enum members. llvm-svn: 153304
* PR11850 + duplicates: don't assume that a function parameter pack expansion isRichard Smith2012-03-131-0/+46
| | | | | | at the end of the parameter list. llvm-svn: 152618
* Improve diagnostics a bit for bad member initializers, and fix an obscure ↵Eli Friedman2012-02-221-0/+10
| | | | | | bug involving packs. Fixes PR12049. llvm-svn: 151130
* Represent C++ direct initializers as ParenListExprs before semantic analysisSebastian Redl2012-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of having a special-purpose function. - ActOnCXXDirectInitializer, which was mostly duplication of AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days ago), is dropped completely. - MultiInitializer, which was an ugly hack I added, is dropped again. - We now have the infrastructure in place to distinguish between int x = {1}; int x({1}); int x{1}; -- VarDecl now has getInitStyle(), which indicates which of the above was used. -- CXXConstructExpr now has a flag to indicate that it represents list- initialization, although this is not yet used. - InstantiateInitializer was renamed to SubstInitializer and simplified. - ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which always produces a ParenListExpr. Placed that so far failed to convert that back to a ParenExpr containing comma operators have been fixed. I'm pretty sure I could have made a crashing test case before this. The end result is a (I hope) considerably cleaner design of initializers. More importantly, the fact that I can now distinguish between the various initialization kinds means that I can get the tricky generalized initializer test cases Johannes Schaub supplied to work. (This is not yet done.) This commit passed self-host, with the resulting compiler passing the tests. I hope it doesn't break more complicated code. It's a pretty big change, but one that I feel is necessary. llvm-svn: 150318
* When a pack expansion occurs in the template argument list of an aliasDouglas Gregor2012-02-031-0/+7
| | | | | | | | template without a corresponding parameter pack, don't immediately substitute the alias template. This is under discussion in the C++ committee, and may become ill-formed, but for now we match GCC. llvm-svn: 149697
OpenPOWER on IntegriCloud