Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9148479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:17:01+00:00 2026-06-17T11:17:01+00:00

Having an issue getting this syntax to compile using the Visual Studio Nov 2012

  • 0

Having an issue getting this syntax to compile using the Visual Studio Nov 2012 CTP C++ Compiler … Just wanted to be sure I wasn’t missing something obvious.

Thanks!

EDIT: Removed Header to make it even simpler.

class Location
{
public:
    Location();
};

class Shape
{
public:
    Shape();
    Shape(Location location);
};


// Doing this by pointer works ...
// Shape::Shape(Location* location){}
// Shape::Shape() : Shape(new Location()){}

Shape::Shape(Location location)
{
}

Shape::Shape()
    : Shape(Location())
    // error C2143: syntax error: missing ';' before ':'
{
    // int x = 0;
    // (void) x;  // Added these two lines in some cases to get it to compile.
    // These two lines do nothing, but get around a compiler issue.
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:17:03+00:00Added an answer on June 17, 2026 at 11:17 am
    // .h Simplification
    class Location
    {
    public:
      Location() {}
      Location(Location const& other) {}
    };
    
    class Shape
    {
      Shape();
      Shape(Location location);
    };
    
    // How about by value or reference?
    Shape::Shape(Location location)
    {
    }
    
    Shape::Shape(void)
      : Shape(Location()) // error C1001: An internal error has occurred in the compiler.
    {
    }
    
    int main() {}
    

    The above code compiles and runs in gcc 4.7.2

    I had to make a few changes to your code to make it compile. When simplifying things, try to keep the simplified code compiling. http://sscce.org/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue getting the following syntax to work: <rewriter> <!-- This does
I'm having an issue getting this CSS for a sprite sheet to work on
I'm having an issue getting a LINQ query to work. I have this XML:
I'm having this issue since offline_access has been deprecated and migration enabled. I'm getting
I am getting into C# and I am having this issue: namespace MyDataLayer {
I'm having an issue getting Appstats to work correctly. Using /appstats or /appstats/stats ends
having an issue getting this to work. MySQL keeps throwing the following: ERROR 1064
I've been having an issue getting this working. I am able to get the
I'm having an issue getting a COUNT() from a SQL query using Zend_Db_Table_Select, and
Having this issue getting a background to work... It requires an image of 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.