Modern C++ Singleton Template
Okay so first of the obligatory Singletons are bad practice so you probably shouldn't make it easy to write bad code. 

Ignoring the fact that the class probably shouldn't exist at all we can look at the code.

static T&amp; GetInstance() {
  static MemGuard g; // clean up on program end
  if (!m_instance) {
    m_instance = new T(); 
  }
  return *m_instance;
}


If multiple threads access this instance simultaneously before it is created, you have a data race and m_instance may end up be being constructed multiple times or other kinds of undefined behaviour. You need to add mutex locks around the if block or use std::call_once which is preferred.

As it is supposed to be a singleton you're not supposed to be able to create more instances as the meaning of a singleton is to just have one instance but it appears that it is fully possible to construct multiple instances of Test  simply by creating them as local variables. So this is a design flaw in your template. 

A much better way of creating a singleton is to rely on C++11 Magic Statics (N2660). And simply do this:

class Test{
private:
    Test(); // Disallow instantiation outside of the class.
public:
    Test(const Test&amp;) = delete;
    Test&amp; operator=(const Test &amp;) = delete;
    Test(Test &amp;&amp;) = delete;
    Test &amp; operator=(Test &amp;&amp;) = delete;

    static auto&amp; instance(){
        static Test test;
        return test;
    }
}; 


Which is much easier to write than your code, it's thread safe and fixes the issues with allowing Test to be instantiated. The properties of magic statics guarantee that test will be initialised exactly once the first time the function body is entered by any thread, even in the presence of multiple threads that might otherwise cause a data-race. The instance will be deconstructed when your main() function returns (in the static destruction stage) which makes the whole MemGuard thing unnecessary.