|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2 |
|
| #
b5f2c4e4 |
| 02-Jun-2020 |
Richard Smith <richard@metafoo.co.uk> |
PR23029 / C++ DR2233: Allow expanded parameter packs to follow parameters with default arguments.
Directly follow the wording by relaxing the AST invariant that all parameters after one with a defau
PR23029 / C++ DR2233: Allow expanded parameter packs to follow parameters with default arguments.
Directly follow the wording by relaxing the AST invariant that all parameters after one with a default arguemnt also have default arguments, and removing the diagnostic on missing default arguments on a pack-expanded parameter following a parameter with a default argument.
Testing also revealed that we need to special-case explicit specializations of templates with a pack following a parameter with a default argument, as such explicit specializations are otherwise impossible to write. The standard wording doesn't address this case; a issue has been filed.
This exposed a bug where we would briefly consider a parameter to have no default argument while we parse a delay-parsed default argument for that parameter, which is also fixed.
Partially incorporates a patch by Raul Tambre.
show more ...
|
|
Revision tags: llvmorg-10.0.1-rc1 |
|
| #
0c42539d |
| 28-Mar-2020 |
Richard Smith <richard@metafoo.co.uk> |
Improve error recovery from missing '>' in template argument list.
Produce the conventional "to match this '<'" note, so that the user knows why we expected a '>', and properly handle '>>' in C++11
Improve error recovery from missing '>' in template argument list.
Produce the conventional "to match this '<'" note, so that the user knows why we expected a '>', and properly handle '>>' in C++11 onwards.
show more ...
|
| #
b3f6e3d6 |
| 28-Mar-2020 |
Richard Smith <richard@metafoo.co.uk> |
Improve recovery from invalid template-ids.
Instead of bailing out of parsing when we encounter an invalid template-name or template arguments in a template-id, produce an annotation token describin
Improve recovery from invalid template-ids.
Instead of bailing out of parsing when we encounter an invalid template-name or template arguments in a template-id, produce an annotation token describing the invalid construct.
This avoids duplicate errors and generally allows us to recover better. In principle we should be able to extend this to store some kinds of invalid template-id in the AST for tooling use, but that isn't handled as part of this change.
show more ...
|
|
Revision tags: llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1, llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1, llvmorg-7.0.1, llvmorg-7.0.1-rc3, llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1, llvmorg-7.0.0, llvmorg-7.0.0-rc3 |
|
| #
5159bbad |
| 05-Sep-2018 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR38627: Fix handling of exception specification adjustment for destructors.
We previously tried to patch up the exception specification after completing the class, which went wrong when the excepti
PR38627: Fix handling of exception specification adjustment for destructors.
We previously tried to patch up the exception specification after completing the class, which went wrong when the exception specification was needed within the class body (in particular, by a friend redeclaration of the destructor in a nested class). We now mark the destructor as having a not-yet-computed exception specification immediately after creating it.
This requires delaying various checks against the exception specification (where we'd previously have just got the wrong exception specification, and now find we have an exception specification that we can't compute yet) when those checks fire while the class is being defined.
This also exposed an issue that we were missing a CodeSynthesisContext for computation of exception specifications (otherwise we'd fail to make the module containing the definition of the class visible when computing its members' exception specs). Adding that incidentally also gives us a diagnostic quality improvement.
This has also exposed an pre-existing problem: making the exception specification evaluation context a non-SFINAE context (as it should be) results in a bootstrap failure; PR38850 filed for this.
llvm-svn: 341499
show more ...
|
|
Revision tags: llvmorg-7.0.0-rc2, llvmorg-7.0.0-rc1, llvmorg-6.0.1, llvmorg-6.0.1-rc3, llvmorg-6.0.1-rc2, llvmorg-6.0.1-rc1, llvmorg-5.0.2, llvmorg-5.0.2-rc2, llvmorg-5.0.2-rc1, llvmorg-6.0.0, llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2, llvmorg-6.0.0-rc1, llvmorg-5.0.1, llvmorg-5.0.1-rc3, llvmorg-5.0.1-rc2, llvmorg-5.0.1-rc1, llvmorg-5.0.0, llvmorg-5.0.0-rc5 |
|
| #
955bb840 |
| 30-Aug-2017 |
Nico Weber <nicolasweber@gmx.de> |
Let -Wdelete-non-virtual-dtor fire in system headers too.
Makes the warning useful again in a std::unique_ptr world, PR28460.
Also make the warning not fire in unevaluated contexts, since system li
Let -Wdelete-non-virtual-dtor fire in system headers too.
Makes the warning useful again in a std::unique_ptr world, PR28460.
Also make the warning not fire in unevaluated contexts, since system libraries (e.g. libc++) do do that. This would've been a good change before we started emitting this warning in system headers too, but "normal" code seems to be less template-heavy, so we didn't notice until now.
https://reviews.llvm.org/D37235
llvm-svn: 312167
show more ...
|
|
Revision tags: llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1, llvmorg-4.0.1, llvmorg-4.0.1-rc3, llvmorg-4.0.1-rc2, llvmorg-4.0.1-rc1, llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3 |
|
| #
df054d3d |
| 25-Feb-2017 |
Richard Smith <richard-llvm@metafoo.co.uk> |
C++ DR1611, 1658, 2180: implement "potentially constructed subobject" rules for special member functions.
Essentially, as a base class constructor does not construct virtual bases, such a constructo
C++ DR1611, 1658, 2180: implement "potentially constructed subobject" rules for special member functions.
Essentially, as a base class constructor does not construct virtual bases, such a constructor for an abstract class does not need the corresponding base class construction to be valid, and likewise for destructors.
This creates an awkward situation: clang will sometimes generate references to the complete object and deleting destructors for an abstract class (it puts them in the construction vtable for a derived class). But we can't generate a "correct" version of these because we can't generate references to base class constructors any more (if they're template specializations, say, we might not have instantiated them and can't assume any other TU will emit a copy). Fortunately, we don't need to, since no correct program can ever invoke them, so instead emit symbols that just trap.
We should stop emitting references to these symbols, but still need to emit definitions for compatibility.
llvm-svn: 296275
show more ...
|
|
Revision tags: llvmorg-4.0.0-rc2, llvmorg-4.0.0-rc1 |
|
| #
d6a15082 |
| 07-Jan-2017 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR23135: Don't instantiate constexpr functions referenced in unevaluated operands where possible.
This implements something like the current direction of DR1581: we use a narrow syntactic check to d
PR23135: Don't instantiate constexpr functions referenced in unevaluated operands where possible.
This implements something like the current direction of DR1581: we use a narrow syntactic check to determine the set of places where a constant expression could be evaluated, and only instantiate a constexpr function or variable if it's referenced in one of those contexts, or is odr-used.
It's not yet clear whether this is the right set of syntactic locations; we currently consider all contexts within templates that would result in odr-uses after instantiation, and contexts within list-initialization (narrowing conversions take another victim...), as requiring instantiation. We could in principle restrict the former cases more (only const integral / reference variable initializers, and contexts in which a constant expression is required, perhaps). However, this is sufficient to allow us to accept libstdc++ code, which relies on GCC's behavior (which appears to be somewhat similar to this approach).
llvm-svn: 291318
show more ...
|
|
Revision tags: llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1 |
|
| #
8dbc6b26 |
| 22-Nov-2016 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Make diagnostic for use of default member initializer before enclosing class is complete a little more general; it is produced in other cases than the one that it previously talked about.
llvm-svn:
Make diagnostic for use of default member initializer before enclosing class is complete a little more general; it is produced in other cases than the one that it previously talked about.
llvm-svn: 287713
show more ...
|
|
Revision tags: llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1, llvmorg-3.8.1, llvmorg-3.8.1-rc1, llvmorg-3.8.0, llvmorg-3.8.0-rc3, llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1, llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1, llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1, llvmorg-3.6.1, llvmorg-3.6.1-rc1, llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2, llvmorg-3.6.0-rc1, llvmorg-3.5.1, llvmorg-3.5.1-rc2, llvmorg-3.5.1-rc1 |
|
| #
d60b82f9 |
| 17-Nov-2014 |
Reid Kleckner <reid@kleckner.net> |
Handle use of default member initializers before end of outermost class
Specifically, when we have this situation: struct A { template <typename T> struct B { int m1 = sizeof(A); };
Handle use of default member initializers before end of outermost class
Specifically, when we have this situation: struct A { template <typename T> struct B { int m1 = sizeof(A); }; B<int> m2; };
We can't parse m1's initializer eagerly because we need A to be complete. Therefore we wait until the end of A's class scope to parse it. However, we can trigger instantiation of B before the end of A, which will attempt to instantiate the field decls eagerly, and it would build a bad field decl instantiation that said it had an initializer but actually lacked one.
Fixed by deferring instantiation of default member initializers until they are needed during constructor analysis. This addresses a long standing FIXME in the code.
Fixes PR19195.
Reviewed By: rsmith
Differential Revision: http://reviews.llvm.org/D5690
llvm-svn: 222192
show more ...
|
| #
0b3a4624 |
| 13-Nov-2014 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR21437, final part of DR1330: delay-parsing of exception-specifications. This is a re-commit of Doug's r154844 (modernized and updated to fit into current Clang).
llvm-svn: 221918
|
| #
72889434 |
| 06-Sep-2014 |
Nico Weber <nicolasweber@gmx.de> |
Add -Wunused-local-typedef, a warning that finds unused local typedefs.
The warning warns on TypedefNameDecls -- typedefs and C++11 using aliases -- that are !isReferenced(). Since the isReferenced(
Add -Wunused-local-typedef, a warning that finds unused local typedefs.
The warning warns on TypedefNameDecls -- typedefs and C++11 using aliases -- that are !isReferenced(). Since the isReferenced() bit on TypedefNameDecls wasn't used for anything before this warning it wasn't always set correctly, so this patch also adds a few missing MarkAnyDeclReferenced() calls in various places for TypedefNameDecls.
This is made a bit complicated due to local typedefs possibly being used only after their local scope has closed. Consider:
template <class T> void template_fun(T t) { typename T::Foo s3foo; // YYY (void)s3foo; } void template_fun_user() { struct Local { typedef int Foo; // XXX } p; template_fun(p); }
Here the typedef in XXX is only used at end-of-translation unit, when YYY in template_fun() gets instantiated. To handle this, typedefs that are unused when their scope exits are added to a set of potentially unused typedefs, and that set gets checked at end-of-TU. Typedefs that are still unused at that point then get warned on. There's also serialization code for this set, so that the warning works with precompiled headers and modules. For modules, the warning is emitted when the module is built, for precompiled headers each time the header gets used.
Finally, consider a function using C++14 auto return types to return a local type defined in a header:
auto f() { struct S { typedef int a; }; return S(); }
Here, the typedef escapes its local scope and could be used by only some translation units including the header. To not warn on this, add a RecursiveASTVisitor that marks all delcs on local types returned from auto functions as referenced. (Except if it's a function with internal linkage, or the decls are private and the local type has no friends -- in these cases, it _is_ safe to warn.)
Several of the included testcases (most of the interesting ones) were provided by Richard Smith.
(gcc's spelling -Wunused-local-typedefs is supported as an alias for this warning.)
llvm-svn: 217298
show more ...
|
|
Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2, llvmorg-3.5.0-rc1, llvmorg-3.4.2, llvmorg-3.4.2-rc1, llvmorg-3.4.1, llvmorg-3.4.1-rc2, llvmorg-3.4.1-rc1, llvmorg-3.4.0, llvmorg-3.4.0-rc3, llvmorg-3.4.0-rc2, llvmorg-3.4.0-rc1, llvmorg-3.3.1-rc1, llvmorg-3.3.0, llvmorg-3.3.0-rc3, llvmorg-3.3.0-rc2, llvmorg-3.3.0-rc1, llvmorg-3.2.0, llvmorg-3.2.0-rc3, llvmorg-3.2.0-rc2, llvmorg-3.2.0-rc1 |
|
| #
e10d304d |
| 07-Nov-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR11851 (and duplicates): Whenever a constexpr function is referenced, instantiate it if it can be instantiated and implicitly define it if it can be implicitly defined. This matches g++'s approach.
PR11851 (and duplicates): Whenever a constexpr function is referenced, instantiate it if it can be instantiated and implicitly define it if it can be implicitly defined. This matches g++'s approach. Remove some cases from SemaOverload which were marking functions as referenced when just planning how overload resolution would proceed; such cases are not actually references.
llvm-svn: 167514
show more ...
|
| #
d3b5c908 |
| 27-Jul-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Final piece of core issue 1330: delay computing the exception specification of a defaulted special member function until the exception specification is needed (using the same criteria used for the de
Final piece of core issue 1330: delay computing the exception specification of a defaulted special member function until the exception specification is needed (using the same criteria used for the delayed instantiation of exception specifications for function temploids).
EST_Delayed is now EST_Unevaluated (using 1330's terminology), and, like EST_Uninstantiated, carries a pointer to the FunctionDecl which will be used to resolve the exception specification.
This is enabled for all C++ modes: it's a little faster in the case where the exception specification isn't used, allows our C++11-in-C++98 extensions to work, and is still correct for C++98, since in that mode the computation of the exception specification can't fail.
The diagnostics here aren't great (in particular, we should include implicit evaluation of exception specifications for defaulted special members in the template instantiation backtraces), but they're not much worse than before.
Our approach to the problem of cycles between in-class initializers and the exception specification for a defaulted default constructor is modified a little by this change -- we now reject any odr-use of a defaulted default constructor if that constructor uses an in-class initializer and the use is in an in-class initialzer which is declared lexically earlier. This is a closer approximation to the current draft solution in core issue 1351, but isn't an exact match (but the current draft wording isn't reasonable, so that's to be expected).
llvm-svn: 160847
show more ...
|
|
Revision tags: llvmorg-3.1.0, llvmorg-3.1.0-rc3, llvmorg-3.1.0-rc2 |
|
| #
38f7c7bc |
| 02-May-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Disable our non-standard delayed parsing of exception specifications. Delaying the parsing of such things appears to be a conforming extension, but it breaks libstdc++4.7's std::pair.
llvm-svn: 1559
Disable our non-standard delayed parsing of exception specifications. Delaying the parsing of such things appears to be a conforming extension, but it breaks libstdc++4.7's std::pair.
llvm-svn: 155975
show more ...
|
| #
84973e56 |
| 21-Apr-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Fix regression in r154844. If necessary, defer computing adjusted destructor exception specifications in C++11 until after we've parsed the exception specifications for nested classes.
llvm-svn: 155
Fix regression in r154844. If necessary, defer computing adjusted destructor exception specifications in C++11 until after we've parsed the exception specifications for nested classes.
llvm-svn: 155293
show more ...
|
|
Revision tags: llvmorg-3.1.0-rc1 |
|
| #
433e0530 |
| 16-Apr-2012 |
Douglas Gregor <dgregor@apple.com> |
Implement the last part of C++ [class.mem]p2, delaying the parsing of exception specifications on member functions until after the closing '}' for the containing class. This allows, for example, a me
Implement the last part of C++ [class.mem]p2, delaying the parsing of 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
show more ...
|
| #
852265ff |
| 30-Mar-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR10217: Provide diagnostics explaining why an implicitly-deleted special member function is deleted.
llvm-svn: 153773
|
| #
74f7d50f |
| 15-Feb-2012 |
Douglas Gregor <dgregor@apple.com> |
When overload resolution picks an implicitly-deleted special member function, provide a specialized diagnostic that indicates the kind of special member function (default constructor, copy assignment
When overload resolution picks an implicitly-deleted special member function, provide a specialized diagnostic that indicates the kind of special member function (default constructor, copy assignment operator, etc.) and that it was implicitly deleted. Add a hook where we can provide more detailed information later.
llvm-svn: 150611
show more ...
|
|
Revision tags: llvmorg-3.0.0, llvmorg-3.0.0-rc4, llvmorg-3.0.0-rc3, llvmorg-3.0.0-rc2, llvmorg-3.0.0-rc1 |
|
| #
9ca5c425 |
| 13-Oct-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Update all tests other than Driver/std.cpp to use -std=c++11 rather than -std=c++0x. Patch by Ahmed Charles!
llvm-svn: 141900
|
| #
938f40b5 |
| 11-Jun-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Implement support for C++11 in-class initialization of non-static data members.
llvm-svn: 132878
|