title: error: expected primary-expression before ';' token
body: <p>I get the error</p>
  
  <pre><code>error: expected primary-expression before ';' token
  </code></pre>
  
  <p>when I try to compile the following code. What is the problem?   </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdexcept&gt;
  #include &lt;exception&gt;
  using namespace std;
  
  class MyException : public std::invalid_argument{};
  
  int main() {
      try {
          throw MyException; //here is the problem
      }
      catch (...){
      }
  
      return 0;
  }
  </code></pre>
  
  <p>I tried also this code</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdexcept&gt;
  #include &lt;exception&gt;
  using namespace std;
  
  class MyException : public std::invalid_argument{};
  
  int main() {
      try {
          throw MyException(); //here is the problem
      }
      catch (...){
      }
  
      return 0;
  }
  </code></pre>
  
  <p>but then I get another error</p>
  
  <pre><code>main.cpp: In constructor ‘MyException::MyException()’:
  main.cpp:6:7: error: no matching function for call to ‘std::invalid_argument::invalid_argument()’
  main.cpp:6:7: note: candidates are:
  In file included from main.cpp:2:0:
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/stdexcept:86:14: note: std::invalid_argument::invalid_argument(const string&amp;)
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/stdexcept:86:14: note:   candidate expects 1 argument, 0 provided
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/stdexcept:83:9: note: std::invalid_argument::invalid_argument(const std::invalid_argument&amp;)
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/stdexcept:83:9: note:   candidate expects 1 argument, 0 provided
  main.cpp: In function ‘int main()’:
  main.cpp:10:27: note: synthesized method ‘MyException::MyException()’ first required here 
  </code></pre>