Okay subho. As I promised here's a detailed discussion. (However, you need to read a bit of inductance). The point is that we generally tend to compartmentalize a real situation. For example, since we are dealing with capacitors we generally ignore some other characteristic property that all physical situations will have. As in this case, if we try to charge the capacitor via superconductor wires connected to an ideal battery, we still need to take into account the physical property of self-inductance (don't confuse this with self-indulgance [6])which any conductor possesses.
Basically, the inductance is something like an (electrical) inertia. The system does not want to change its state. If a current is flowing in a conductor, it will try its best even if you cut it (that's the reason why you see a spark when you switch something off --- the self inductance tries its best to maintain it even if it means jumping across a gap). Similarly, if you want to establish a current, the self-inductance tries to oppose it by inducing an emf in the opposite direction.
Suppose the wires have an inductance L. Let's look at the transients when the capacitor is being charged up. Suppose at any instant a charge q has been accumulated on the capacitor's plates and at that instant a current I is there in the circuit. In the next dt interval of time, a charge dq = I dt will flow through the battery, which will do a work
δW = I dt V0
on it. (V0 is the emf of the battery). Part of this work will go to increase the magnetic energy (there always a magnetic field around a current, and the magnetic energy is 12 LI2) and the rest of the energy goes to increase the capacitors electrical energy. Using the fact that the increment in the magnetic energy is LI dI and the increment in the capacitor's energy is qC dq, and using the work energy principle, we get
I V_0\,\mathrm dt = LI\,\mathrm dI + \frac{q}{C}\,\mathrm dq
Dividing through out by dt, we get
I V_0 = LI\dfrac{\mathrm dI}{\mathrm dt} + \frac{q}{C}\dfrac{\mathrm dq}{\mathrm dt}
Using the fact that I = dq/dt, we obtain finally the equation
\dfrac{d^2q}{\mathrm dt^2}+\dfrac{1}{LC}\,q=\dfrac{V_0}{L}
Define 1LC =ω02
Then the previous equation becomes
\dfrac{d^2q}{\mathrm dt^2}+\omega_0^2q=\dfrac{V_0}{L}
Take V0/L to the left and pull outω02 common out to get
\dfrac{d^2q}{\mathrm dt^2}+\omega_0^2\left(q-\dfrac{V_0}{\omega_0^2L}\right)=0
Using \xi =q-\dfrac{V_0}{\omega_0^2L}\qquad \Rightarrow \dfrac{\mathrm d^2\xi}{\mathrm dt^2}=\dfrac{\mathrm d^2q}{\mathrm dt^2}
the above equation finally transforms to SHM equation
\dfrac{\mathrm d^2\xi}{\mathrm dt^2}+\omega_0^2\xi=0
So the variable ξ (and hence q) oscillates simple harmonically with an angular frequency ω0. We can write out the solution as
\xi =A\cos(\omega_0t+\varphi)\quad \Rightarrow \ q=\dfrac{V_0}{\omega_0^2L}+A\cos(\omega_0t+\varphi)
However, ω02 L = 1/C, hence we ultimately get
\boxed{q=CV_0+A\cos(\omega_0t+\varphi)}
The term CV0 is easily seen to be the equilibrium charge. So then in this case the charge will actually oscillate about its usual equilibrium value. The same thing remains true for the energy of the capacitor as well. At any moment, the energy will in general not same as CV02/2, however the average value will turn out to be that much. So that means while charging via resistance-less wires, the extra work done by the battery will be in the magnetic field of the current in the wire.
P.S. Though I am pretending no loss in the above discussion, actually while the charge surges to and fro in the capacitor, it will behave like a dipole antenna and electromagnetic radiations will continuously come out taking away with them some energy. Once the battery has ran out of its emf source, the oscillations will start to damp out and finally all the energy will be gone. In this case, it will seem that the capacitor will discharge through a "characteristic" resistance given by √μ0/ε0 ≈ 376.7 Ω. This effective resistance is called the impedance of free space.