summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-local-class.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Only instantiate members of nested classes in local classes once, rather ↵Richard Smith2017-01-041-0/+11
| | | | | | than once per enclosing class. llvm-svn: 291034
* Correctly type-check the default arguments of local functionsJohn McCall2015-12-111-0/+27
| | | | | | | | when eagerly instantiating them. rdar://23721638 llvm-svn: 255325
* [MSVC Compat] Try to treat an implicit, fixed enum as an unfixed enumDavid Majnemer2015-10-081-2/+2
| | | | | | | | | | | | | | | | | | consider the following: enum E *p; enum E { e }; The above snippet is not ANSI C because 'enum E' has not bee defined when we are processing the declaration of 'p'; however, it is a popular extension to make the above work. This would fail using the Microsoft enum semantics because the definition of 'E' would implicitly have a fixed underlying type of 'int' which would trigger diagnostic messages about a mismatch between the declaration and the definition. Instead, treat fixed underlying types as not fixed for the purposes of the diagnostic. llvm-svn: 249674
* Update a few more tests in response to the MS ABI enum semanticsDavid Majnemer2015-10-081-2/+2
| | | | | | | Our self hosting buildbots found a few more tests which weren't updated to reflect that the enum semantics are part of the Microsoft ABI. llvm-svn: 249670
* Instantiation of local class members.Serge Pavlov2015-06-291-0/+54
| | | | | | | | | | | | If a function containing a local class is instantiated, instantiate all of local class member, including default arguments and exception specifications. This change fixes PR21332 and thus implements DR1484. Differential Revision: http://reviews.llvm.org/D9990 llvm-svn: 240974
* Limit set of types instantiated in FindInstantiatedDecl.Serge Pavlov2015-05-151-0/+37
| | | | | | | | Starting from r236426 FindInstantiatedDecl may instantiate types that are referenced before definition. This change limit the set of types that can be instantiated by this function. llvm-svn: 237434
* PR20625: Instantiate static constexpr member function of a local struct in a ↵Richard Smith2015-05-111-0/+15
| | | | | | | | | | | | | | | function template earlier. This is necessary in order to allow the use of a constexpr member function, or a member function with deduced return type, of a local class within a surrounding instantiated function template specialization. Patch by Michael Park! This re-commits r236063, which was reverted in r236134, along with a fix for a delayed template parsing bug that was exposed by this change. llvm-svn: 237064
* Instantiate incomplete class used in template method.Serge Pavlov2015-05-041-0/+129
| | | | | | | | | | | If a class is absent from instantiation and is incomplete, instantiate it as an incomplete class thus avoiding compiler crash. This change fixes PR18653. Differential Revision: http://reviews.llvm.org/D8281 llvm-svn: 236426
* Revert r236063 due to regression with -fdelayed-template-parsing.Richard Smith2015-04-291-13/+0
| | | | llvm-svn: 236134
* PR20625: Instantiate static constexpr member function of a local struct in a ↵Richard Smith2015-04-291-0/+13
| | | | | | | | | | | | function template earlier. This is necessary in order to allow the use of a constexpr member function, or a member function with deduced return type, of a local class within a surrounding instantiated function template specialization. Patch by Michael Park! llvm-svn: 236063
* Combine instantiation context of field initializer with context of class.Serge Pavlov2015-04-281-0/+19
| | | | | | | | | | | | | | Inclass initializer is instantiated in its own LocalInstantiationScope. It causes problems when instantiating local classes - when instantiation scope is searched for DeclContext of the field, the search fails. As a solution, the instantiation scope of field initializer is combined with its outer scope. This patch fixes PR23194. Differential Revision: http://reviews.llvm.org/D9258 llvm-svn: 236005
* Sema: Don't crash when trying to instantiate a local class with an invalid ↵David Majnemer2014-02-221-1/+14
| | | | | | | | | | | | | | | | base specifier It was previously thought that Sema::InstantiateClass could not fail from within this point in instantiate. However, it can happen if the class is invalid some way (i.e. invalid base specifier). This fixes PR18907. Differential Revision: http://llvm-reviews.chandlerc.com/D2850 llvm-svn: 201913
* Add a return statement to the func with an int return type.Kaelyn Uhrain2013-11-281-0/+1
| | | | llvm-svn: 195897
* Sema: Instantiation of variable definitions weren't local enoughDavid Majnemer2013-11-271-0/+20
| | | | | | | | | | | We wouldn't properly save and restore the pending local instantiations we had built up prior to instantiation of a variable definition. This would lead to us instantiating too much causing crashes and other general badness. This fixes PR14374. llvm-svn: 195887
* Sema: Instantiate local class and their members appropriatelyDavid Majnemer2013-11-271-1/+95
| | | | | | | | | | | We would fail to instantiate them when the surrounding function was instantiated. Instantiate the class and add it's members to the list of pending instantiations, they should be resolved when we are finished with the function's body. This fixes PR9685. llvm-svn: 195827
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-191-0/+1
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* For member pointer conversions potentially involving derived-to-baseDouglas Gregor2010-12-211-2/+4
| | | | | | | | | conversions, make sure that the (possibly) derived type is complete before looking for base classes. Finishes the fix for PR8801. llvm-svn: 122363
* When searching for the instantiation of a locally-scoped tagDouglas Gregor2010-12-211-0/+13
| | | | | | | declaration, also look for an instantiation of its previous declarations. Fixes PR8801. llvm-svn: 122361
* Turn access control on by default in -cc1.John McCall2010-04-091-2/+2
| | | | | | | | Remove -faccess-control from -cc1; add -fno-access-control. Make the driver pass -fno-access-control by default. Update a bunch of tests to be correct under access control. llvm-svn: 100880
* Fix instantiation of template functions with local classes that contain virtualChandler Carruth2010-02-151-0/+18
| | | | | | methods. llvm-svn: 96283
* Introduce a second queue of "local" pending implicit instantiation,Douglas Gregor2010-01-161-1/+4
| | | | | | | | | | which are instantiations of the member functions of local classes. These implicit instantiations have to occur at the same time as---and in the same local instantiation scope as---the enclosing function, since the member functions of the local class can refer to locals within the enclosing function. This should really, really fix PR5764. llvm-svn: 93666
* While determining when to parse inline member functions of a class,Douglas Gregor2010-01-161-0/+19
| | | | | | | | | | | | distinguish between nested classes (whose member functions cannot be parsed until the innermost non-nested class is complete) and local classes (that are defined within a function but are not necessarily nested). The upshot of this change, which fixes PR5764, is that the bodies of member functions of local (non-nested) classes need to be parsed when the local class is complete (and no later), since they may refer to function-local static variables, typedefs, enums, etc. llvm-svn: 93653
* When we are instantiating a member function of a local class, be sureDouglas Gregor2010-01-161-0/+12
to merge the local instantiation scope with the outer local instantiation scope, so that we can instantiate declarations from the function owning the local class. Fixes an assert while instantiating Boost.MPL's BOOST_MPL_ASSERT_MSG. llvm-svn: 93651
OpenPOWER on IntegriCloud