Imports not used in the country, still counting in the GDP calculation?

When we calculating GDP we use the given formula

$$GDP = C + I + P + X - M$$

Here $$M$$ means the imports.

My question is: What if I am not currently using the imports. For example I might have by the goods and preserve in the warehouse. In that case, Do the imports really affects GDP.

GDP is the total amount of domestically produced output in the referred period. If $$C^H$$ is the consumption of domesticly produced goods, $$C^F$$ is the cosumption of goods produced abroad, $$G^H$$ is the government expenditure on domesticly produced goods, $$G^F$$ is the government expenditure on goods produced abroad and so on we have:
$$GDP = C^H + G^H + I^H + X = \\ C-C^F + G-G^F + I-I^F + X =\\ C + G + I + X - (C^F +G^F +I^F) \\= C + G + I + X - M$$
My textbook (Mankiw) used to say: If you purchase goods abroad and store them, this is an investment into inventory in the period in which they were imported i.e. $$I^F$$ goes up. This is the same as if you produce a car at home and fail to sell it. In this case the car is counted in $$I^H$$.