From b88369f5e8fc89724e6f4f3c266e576a2608ae7b Mon Sep 17 00:00:00 2001 From: Thad House Date: Mon, 24 Dec 2018 13:46:12 -0800 Subject: [PATCH] Move deprecation warning for SampleRobot to constructor (#1503) This way, the warning doesn't occur when including wpilib.h Closes #1501 --- wpilibc/src/main/native/include/frc/SampleRobot.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/wpilibc/src/main/native/include/frc/SampleRobot.h b/wpilibc/src/main/native/include/frc/SampleRobot.h index a0e97b1b75..4bce0f30e7 100644 --- a/wpilibc/src/main/native/include/frc/SampleRobot.h +++ b/wpilibc/src/main/native/include/frc/SampleRobot.h @@ -13,11 +13,7 @@ namespace frc { -class WPI_DEPRECATED( - "WARNING: While it may look like a good choice to use for your code if " - "you're inexperienced, don't. Unless you know what you are doing, complex " - "code will be much more difficult under this system. Use TimedRobot or " - "Command-Based instead.") SampleRobot : public RobotBase { +class SampleRobot : public RobotBase { public: /** * Start a competition. @@ -95,6 +91,11 @@ class WPI_DEPRECATED( virtual void RobotMain(); protected: + WPI_DEPRECATED( + "WARNING: While it may look like a good choice to use for your code if " + "you're inexperienced, don't. Unless you know what you are doing, " + "complex code will be much more difficult under this system. Use " + "TimedRobot or Command-Based instead.") SampleRobot(); virtual ~SampleRobot() = default;