Commit Graph

12 Commits

Author SHA1 Message Date
David Majnemer a64cb5a019 Sema: Don't crash when trying to instantiate a local class with an invalid 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
2014-02-22 00:17:46 +00:00
Kaelyn Uhrain 297a1381ad Add a return statement to the func with an int return type.
llvm-svn: 195897
2013-11-28 00:13:38 +00:00
David Majnemer fd6c685f2e Sema: Instantiation of variable definitions weren't local enough
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
2013-11-27 22:57:44 +00:00
David Majnemer 192d1798b2 Sema: Instantiate local class and their members appropriately
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
2013-11-27 08:20:38 +00:00
Andy Gibbs c6e68daac0 Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive.
llvm-svn: 166280
2012-10-19 12:44:48 +00:00
Douglas Gregor 7f6ae6958c For member pointer conversions potentially involving derived-to-base
conversions, make sure that the (possibly) derived type is complete
before looking for base classes.

Finishes the fix for PR8801.

llvm-svn: 122363
2010-12-21 21:40:41 +00:00
Douglas Gregor e9fc8dc84c When searching for the instantiation of a locally-scoped tag
declaration, also look for an instantiation of its previous
declarations. Fixes PR8801.

llvm-svn: 122361
2010-12-21 21:22:51 +00:00
John McCall 3155f573f5 Turn access control on by default in -cc1.
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
2010-04-09 19:03:51 +00:00
Chandler Carruth 3e0c140c50 Fix instantiation of template functions with local classes that contain virtual
methods.

llvm-svn: 96283
2010-02-15 22:12:26 +00:00
Douglas Gregor 7f792cf329 Introduce a second queue of "local" pending implicit instantiation,
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
2010-01-16 22:29:39 +00:00
Douglas Gregor edf8f39003 While determining when to parse inline member functions of a class,
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
2010-01-16 20:52:59 +00:00
Douglas Gregor f5974fa0d5 When we are instantiating a member function of a local class, be sure
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
2010-01-16 20:21:20 +00:00