Q:

No call to the copy constructor

Consider the given code
struct ABC
{
    ABC()
    {
        std::cout<<" Calling from default constructor";
    }

    ABC(const ABC &copy)
    {
        std::cout<<"Calling from copy constructor";
    }
};

int main()
{
    ABC abc = ABC();
}

I have two questions

Q1) Removing const from the copy constructor parameter declaration gives error. Why?
Q2) After adding the const keyword I dont see a call to the copy constructor. Why? The copy constructor does not get called so why is the const necessary?

TIA

A:

You need the const because you try to initialize abc with a temporary ABC() which is const. Hence if the constructor is not const the compiler must reject the code.
After you make it const the code is standard complaint and the compiler can compile it. However it's allowed to optimize out the copy in this case as said in the standard, so it removes the call to the copy constructor.

A:

Q1) Removing const from the copy
  constructor parameter declaration
  gives error. Why?

ABC abc = ABC();

is equivalent to 
ABC abc((ABC()));

Since you are passing a temporary to the copy constructor, it can only bind to const references, not non-const references.
A copy constructor can take non-const references (e.g std::auto_ptr), but this means their usage is more restricted.

Q2) After adding the const keyword I
  dont see a call to the copy
  constructor. Why? The copy constructor
  does not get called so why is the
  const necessary?

In the given scenario the compiler is allowed to optimize redundant calls to constructor away. Why create a default object only to copy it, if it could just invoke the default constructor alone?
However, even if calls to copy constructor are optimized away, the compiler has to check that the code would be valid as written - as if the copy construction was not optimized away.

