mirror of
https://github.com/verilator/verilator.git
synced 2025-01-08 15:47:36 +00:00
Internals: Fix VL_RESTORER behavior on passing a lvalue reference (#3326)
Signed-off-by: HungMingWu <u9089000@gmail.com>
This commit is contained in:
parent
b6ca2a42f2
commit
43a84d7ad8
@ -43,7 +43,7 @@ class V3HierBlockPlan;
|
||||
/// end-of-stope.
|
||||
// Object must be named, or it will not persist until end-of-scope.
|
||||
// Constructor needs () or GCC 4.8 false warning.
|
||||
#define VL_RESTORER(var) const VRestorer<decltype(var)> restorer_##var(var);
|
||||
#define VL_RESTORER(var) const VRestorer<typename std::decay<decltype(var)>::type> restorer_##var(var);
|
||||
|
||||
// Object used by VL_RESTORER. This object must be an auto variable, not
|
||||
// allocated on the heap or otherwise.
|
||||
|
Loading…
Reference in New Issue
Block a user