title: Is it possible to construct a temporary variable in the global scope?
body: <p>For an arbitrary class,</p>
  
  <pre><code>template&lt;class T&gt;
  struct S
  {
      S()
      {
          cout &lt;&lt; "hello moto\n";
      }
  };
  </code></pre>
  
  <p>it is possible to construct an temporary object that's destroyed immediately after its creation, but only inside <strong>functions</strong>, e.g.</p>
  
  <pre><code>void f()
  {
      S&lt;int&gt;();
  }
  </code></pre>
  
  <p>Moving <code>S&lt;int&gt;();</code> outside in the global scope either does not compile in GCC, or is compiled as being a function declaration in VC++.</p>
  
  <p>Is it even possible to create a global temporary object?</p>
  
  <hr>
  
  <h3>Edit</h3>
  
  <p>Although the demo code is in the form of a template class, it does have to be for my question; a plain C struct would do. But with a class it is easy to see whether this temp is actually created or not so as to be be sure this clause is not interpreted as a function declaration instead by the compiler.</p>