From: Akim Demaille Date: Fri, 18 Jul 2008 16:37:40 +0000 (+0200) Subject: Let yy::variant::build return an lvalue. X-Git-Tag: v2.7.90~1168 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/8b9c89fb65d758e99602c068e16bfbf109437e42 Let yy::variant::build return an lvalue. * data/lalr1-fusion.cc (variant::build): Return a reference to the object. --- diff --git a/ChangeLog b/ChangeLog index b69409c7..0400e19c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-03 Akim Demaille + + Let yy::variant::build return an lvalue. + * data/lalr1-fusion.cc (variant::build): Return a reference to the + object. + 2008-11-03 Akim Demaille Define yy::variant only when needed. diff --git a/data/lalr1-fusion.cc b/data/lalr1-fusion.cc index ca5da6a5..3a629aaf 100644 --- a/data/lalr1-fusion.cc +++ b/data/lalr1-fusion.cc @@ -167,10 +167,10 @@ dnl FIXME: This is wrong, we want computed header guards. { /// Instantiate a \a T in here. template - inline void + inline T& build() { - new (buffer) T; + return *new (buffer) T; } /// Destroy the stored \a T.