summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp/temp.spec/temp.explicit
Commit message (Collapse)AuthorAgeFilesLines
* [c++20] Implement P0846R0: allow (ADL-only) calls to template-ids whoseRichard Smith2019-05-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make '-disable-llvm-optzns' an alias for '-disable-llvm-passes'.Chandler Carruth2016-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Much to my surprise, '-disable-llvm-optzns' which I thought was the magical flag I wanted to get at the raw LLVM IR coming out of Clang deosn't do that. It still runs some passes over the IR. I don't want that, I really want the *raw* IR coming out of Clang and I strongly suspect everyone else using it is in the same camp. There is actually a flag that does what I want that I didn't know about called '-disable-llvm-passes'. I suspect many others don't know about it either. It both does what I want and is much simpler. This removes the confusing version and makes that spelling of the flag an alias for '-disable-llvm-passes'. I've also moved everything in Clang to use the 'passes' spelling as it seems both more accurate (*all* LLVM passes are disabled, not just optimizations) and much easier to remember and spell correctly. This is part of simplifying how Clang drives LLVM to make it cleaner to wire up to the new pass manager. Differential Revision: https://reviews.llvm.org/D28047 llvm-svn: 290392
* DR259: Demote the pedantic error for an explicit instantiation after anRichard Smith2016-08-311-7/+8
| | | | | | | | | 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
* Lit C++11 Compatibility Patch #7Charles Li2016-04-132-3/+23
| | | | | | | 13 tests have been updated for C++11 compatibility. Differential Revision: http://reviews.llvm.org/D19068 llvm-svn: 266239
* [Lit Test] Updated 34 Lit tests to be C++11 compatible.Charles Li2015-11-171-0/+5
| | | | | | | Added expected diagnostics new to C++11. Expanded RUN line to: default, C++98/03 and C++11. llvm-svn: 253371
* C++1y is now C++14!Aaron Ballman2014-08-191-1/+1
| | | | | | 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
* CodeGen: Fix linkage of reference temporariesDavid Majnemer2014-04-281-2/+2
| | | | | | | | | | | | | | | Summary: A reference temporary should inherit the linkage of the variable it initializes. Otherwise, we may hit cases where a reference temporary wouldn't have the same value in all translation units. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3515 llvm-svn: 207451
* Disable llvm optimizations, but keep -O1 to test available_externally.Rafael Espindola2013-09-041-1/+1
| | | | llvm-svn: 189919
* The 'constexpr implies const' rule for non-static member functions is gone inRichard Smith2013-04-211-1/+1
| | | | | | | | | 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
* PR12008: defer adding the implicit 'const' to a constexpr member function untilRichard Smith2013-01-141-1/+1
| | | | | | we know whether it is static. llvm-svn: 172376
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-193-0/+3
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* hopefully fix a bunch of ARM buildbot failuresNuno Lopes2012-05-091-1/+1
| | | | llvm-svn: 156513
* Change how we suppress access control in explicit instantiationsJohn McCall2012-05-071-3/+46
| | | | | | | | | | so that we actually accumulate all the delayed diagnostics. Do this so that we can restore those diagnostics to good standing if it turns out that we were wrong to suppress, e.g. if the tag specifier is actually an elaborated type specifier and not a declaration. llvm-svn: 156291
* Support for definitions of member enumerations of class templates outside theRichard Smith2012-03-231-0/+9
| | | | | | | class template's definition, and for explicit specializations of such enum members. llvm-svn: 153304
* Instantiating a class template should not instantiate the definition of anyRichard Smith2012-03-141-5/+18
| | | | | | | | scoped enumeration members. Later uses of an enumeration temploid as a nested name specifier should cause its instantiation. Plus some groundwork for explicit specialization of member enumerations of class templates. llvm-svn: 152750
* Fix a crash on invalid, http://llvm.org/pr11599Nico Weber2011-12-201-0/+7
| | | | llvm-svn: 146988
* Make the -Wc++11-compat warnings ignored by default, so we don't breakDouglas Gregor2011-10-253-3/+3
| | | | | | | valid C++98/03 code. However, add these warnings to -Wall, for those who obviously already like clean code. llvm-svn: 142903
* 'extern template' is a C++11 feature. Add an Extension for C++98 (this matchesRichard Smith2011-10-201-1/+1
| | | | | | gcc's behaviour), and a -Wc++98-compat-pedantic warning for C++11. llvm-svn: 142597
* [temp.explicit]p1: constexpr cannot be specified in explicit instantiations.Richard Smith2011-10-141-2/+7
| | | | llvm-svn: 141982
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-134-4/+4
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Factor out (some of) the checking for invalid forms of pointerChandler Carruth2011-06-271-2/+2
| | | | | | | | | | | | | | | | | | | arithmetic into a couple of common routines. Use these to make the messages more consistent in the various contexts, especially in terms of consistently diagnosing binary operators with invalid types on both the left- and right-hand side. Also, improve the grammar and wording of the messages some, handling both two pointers and two (different) types. The wording of function pointer arithmetic diagnostics still strikes me as poorly phrased, and I worry this makes them slightly more awkward if more consistent. I'm hoping to fix that with a follow-on patch and test case that will also make them more helpful when a typedef or template type parameter makes the type completely opaque. Suggestions on better wording are very welcome, thanks to Richard Smith for some initial help on that front. llvm-svn: 133906
* Downgrade the warning about the use of typedefs for class templateDouglas Gregor2011-06-071-2/+2
| | | | | | | | specializations within an explicit instantiation to default to off (enabled by -pedantic). Nobody else seem to implement C++ [temp.explicit]p3. Fixes PR10093. llvm-svn: 132704
* Template static data members can have weak_odr linkage, not justJohn McCall2011-04-121-4/+4
| | | | | | | | weak linkage. Also, fix a problem where global weak variables with non-trivial initializers were getting guard variables, or at least were checking for them and then crashing. llvm-svn: 129342
* Support explicit template specialization and instantiation for membersDouglas Gregor2011-03-071-0/+65
| | | | | | | | | | | of a C++0x inline namespace within enclosing namespaces, as noted in C++0x [namespace.def]p8. Fixes <rdar://problem/9006349>, a libc++ failure where Clang was rejected an explicit specialization of std::swap (since libc++ puts it into an inline, versioned namespace std::__1). llvm-svn: 127162
* remove curly quotes, patch by Dimitry Andric!Chris Lattner2010-09-061-1/+1
| | | | llvm-svn: 113156
* Support explicit instantiation of function templates and members of classChandler Carruth2010-08-251-1/+26
| | | | | | | | | | | | | templates when only the declaration is in scope. This requires deferring the instantiation to be lazy, and ensuring the definition is required for that translation unit. We re-use the existing pending instantiation queue, previously only used to track implicit instantiations which were required to be lazy. Fixes PR7979. A subsequent change will rename *PendingImplicitInstantiations to *PendingInstatiations for clarity given its broader role. llvm-svn: 112037
* Reinstate the optimization suppressing available_externally functionsDouglas Gregor2010-07-131-1/+1
| | | | | | | | at -O0. The only change from the previous patch is that we don't try to generate virtual method thunks for an available_externally function. llvm-svn: 108230
* Speculatively revert r108156; it appears to be breaking self-host.Douglas Gregor2010-07-121-1/+1
| | | | llvm-svn: 108194
* Do not generate LLVM IR for available_externally function bodies atDouglas Gregor2010-07-121-1/+1
| | | | | | | | | | -O0, since we won't be using the definitions for anything anyway. For lib/System/Path.o when built in Debug+Asserts mode, this leads to a 4% improvement in compile time (and suppresses 440 function bodies). <rdar://problem/7987644> llvm-svn: 108156
* Partial fix for PR7267 based on comments by John McCall on an earlier patch.Chandler Carruth2010-06-281-0/+18
| | | | | | | | | | | | | | | | | | This is more targeted, as it simply provides toggle actions for the parser to turn access checking on and off. We then use these to suppress access checking only while we parse the template-id (included scope specifier) of an explicit instantiation and explicit specialization of a class template. The specialization behavior is an extension, as it seems likely a defect that the standard did not exempt them as it does explicit instantiations. This allows the very common practice of specializing trait classes to work for private, internal types. This doesn't address instantiating or specializing function templates, although those apparently already partially work. The naming and style for the Action layer isn't my favorite, comments and suggestions would be appreciated there. llvm-svn: 106993
* Downgrade the error when using a typedef in the nested-name-specifierDouglas Gregor2010-06-161-3/+3
| | | | | | | of an explicit instantiation to an ExtWarn, since nobody else seems to diagnose this problem. llvm-svn: 106109
* The C++98/03 standard is disturbingly silent about out-of-scopeDouglas Gregor2010-05-112-3/+3
| | | | | | | | | | explicit instantiations of template. C++0x clarifies the intent (they're ill-formed in some cases; see [temp.explicit] for details). However, one could squint at the C++98/03 standard and conclude they are permitted, so reduce the error to a warning (controlled by -Wc++0x-compat) in C++98/03 mode. llvm-svn: 103482
* Only complain about explicit instantiations following explicitDouglas Gregor2010-04-091-11/+11
| | | | | | | | | | | | specializations when the explicit instantiation was... explicitly written, i.e., not the product of an explicit instantiation of an enclosing class. Fixes this spurious warning when Clang builds LLVM: /Volumes/Data/dgregor/Projects/llvm/lib/CodeGen/MachineDominators.cpp:22:1: warning: explicit instantiation of 'addRoot' that occurs after an explicit specialization will be ignored (C++0x extension) [-pedantic] llvm-svn: 100900
* Make CXXScopeSpec invalid when incomplete, and propagate that into anyJeffrey Yasskin2010-04-081-9/+7
| | | | | | | Declarator that depends on it. This fixes several redundant errors and bad recoveries. llvm-svn: 100779
* Give explicit template instantiations weak ODR linkage. FormerDouglas Gregor2010-03-131-2/+2
| | | | | | | | | iterations of this patch gave explicit template instantiation link-once ODR linkage, which permitted the back end to eliminate unused symbols. Weak ODR linkage still requires the symbols to be generated. llvm-svn: 98441
* Re-revert the explicit template instantiation linkage patch. I am beginning ↵Douglas Gregor2010-03-131-2/+2
| | | | | | to look incompetent llvm-svn: 98425
* Reinstate patch to turn explicit template instantiations into weak symbolsDouglas Gregor2010-03-131-2/+2
| | | | llvm-svn: 98424
* Revert the linkage change for explicit template instantiations; something is ↵Douglas Gregor2010-03-121-2/+2
| | | | | | amiss llvm-svn: 98332
* Give explicit template instantiations weak linkage (but don't deferDouglas Gregor2010-03-121-2/+2
| | | | | | them). Fixes PR6578. llvm-svn: 98328
* Suppress implicit member redeclarations arising from explicit instantiationJohn McCall2010-03-021-0/+16
| | | | | | | | | | | | declarations after the member has been explicitly specialized. We already did this after explicit instantiation definitions; not doing it for declarations meant that subsequent definitions would see a previous member declaration with specialization kind "explicit instantiation decl", which would then happily get overridden. Fixes PR 6458. llvm-svn: 97605
* Do not require a complete type when checking for a pointer conversionDouglas Gregor2010-02-221-0/+21
| | | | | | between cv1 T* and cv2 T*. llvm-svn: 96787
* Improve the reporting of non-viable overload candidates by noting the reasonJohn McCall2010-01-131-1/+1
| | | | | | | | why the candidate is non-viable. There's a lot we can do to improve this, but it's a good start. Further improvements should probably be integrated with the bad-initialization reporting routines. llvm-svn: 93277
* Improve the diagnostics used to report implicitly-generated class membersJohn McCall2010-01-061-2/+2
| | | | | | | | | as parts of overload sets. Also, refer to constructors as 'constructors' rather than functions. Adjust a lot of tests. llvm-svn: 92832
* Switch file-scope assignment initialization over to InitializationSequence.Eli Friedman2009-12-222-2/+2
| | | | llvm-svn: 91881
* Switch default-initialization of variables of class type (or array thereof) ↵Douglas Gregor2009-12-201-2/+2
| | | | | | over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one llvm-svn: 91796
* Refactor to remove more dependencies on PreDeclaratorDC. I seem to have madeJohn McCall2009-12-191-8/+6
| | | | | | | the redeclaration problems in the [temp.explicit]p3 testcase worse, but I can live with that; they'll need to be fixed more holistically anyhow. llvm-svn: 91771
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-1514-14/+14
| | | | | | | | | - 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
* Fix some diagnostic-related FIXMEs, from Nicola GiganteDouglas Gregor2009-12-151-1/+1
| | | | llvm-svn: 91433
* Introduce a new class, UnqualifiedId, that provides a parsedDouglas Gregor2009-11-031-2/+2
| | | | | | | | | | | | | | | | representation of a C++ unqualified-id, along with a single parsing function (Parser::ParseUnqualifiedId) that will parse all of the various forms of unqualified-id in C++. Replace the representation of the declarator name in Declarator with the new UnqualifiedId class, simplifying declarator-id parsing considerably and providing more source-location information to Sema. In the future, I hope to migrate all of the other unqualified-id-parsing code over to this single representation, then begin to merge actions that are currently only different because we didn't have a unqualified notion of the name in the parser. llvm-svn: 85851
* Improved fix for PR3844, which recovers better for class templateDouglas Gregor2009-10-301-1/+1
| | | | | | partial specializations and explicit instantiations of non-templates. llvm-svn: 85620
OpenPOWER on IntegriCloud