
448 S.E.2d 115 (1994)
337 N.C. 682
Ruthann M. CAGE
v.
COLONIAL BUILDING COMPANY, INC. OF RALEIGH.
No. 416PA93.
Supreme Court of North Carolina.
September 9, 1994.
*116 Petree Stockton by Kevin L. Miller and M. Gray Styers, Jr., Raleigh, for plaintiff-appellee.
Joslin & Sedberry by William Joslin and Nell Joslin Medlin, Raleigh, for defendant-appellant.
EXUM, Chief Justice.
This case arises out of the allegedly negligent construction by defendant Colonial Building Company, Inc., ("Colonial") of a townhouse subsequently purchased by plaintiff Ruthann Cage. Plaintiff purchased the townhouse more than six years before she brought this action. The question presented is whether the claim is barred by the six-year real property improvement statute of repose, N.C.G.S. § 1-50(5). We conclude the claim is barred and reverse the Court of Appeals' contrary decision.
This appeal is before us by way of the Court of Appeals on a motion to dismiss for failure to state a claim upon which relief can be granted, N.C.R.Civ.P. 12(b)(6); therefore, we take all allegations of fact in the complaint as true. Amos v. Oakdale Knitting Co., 331 N.C. 348, 351, 416 S.E.2d 166, 168 (1992). A motion to dismiss under Rule 12(b)(6) tests the legal sufficiency of the complaint by presenting "the question whether, as a matter of law, the allegations of the complaint, treated as true, are sufficient to state a claim upon which relief can be granted under some [recognized] legal theory." Lynn v. Overlook Dev., 328 N.C. 689, 692, 403 S.E.2d 469, 471 (1991). A Rule 12(b)(6) motion to dismiss for failure to state a claim should not be granted unless it "appears to a certainty that plaintiff is entitled to no relief under any state of facts which could be proved in support of the claim." Sutton v. Duke, 277 N.C. 94, 103, 176 S.E.2d 161, 66 (1970). A statute of limitation or repose may be the basis of a 12(b)(6) dismissal if on its face the complaint reveals the claim is barred by the statute. Oates v. JAG, Inc., 314 N.C. 276, 333 S.E.2d 222 (1985); F.D.I.C. v. Loft Apartments, 39 N.C.App. 473, 250 S.E.2d 693, disc. rev. denied, 297 N.C. 176, 254 S.E.2d 39 (1979); Travis v. McLaughlin, 29 N.C.App. 389, 224 S.E.2d 243, disc. rev. denied, 290 N.C. 555, 226 S.E.2d 513 (1976); Teague v. Asheboro Motor Co., 14 N.C.App. 736, 189 S.E.2d 671 (1972).
Plaintiff's complaint, filed in 1991[1], alleges: Plaintiff purchased her townhouse from Colonial on 7 December 1984. Colonial was in the business of building homes and was the owner of and general contractor for the townhouse when plaintiff purchased it. Water began leaking through the dining room ceiling of plaintiff's townhouse in October 1990 causing certain structural damage. The leakage was caused by improper and negligent construction on the part of Colonial. Repairs were completed in 1991 at substantial cost to plaintiff. The complaint, sounding in negligence and breach of warranty, *117 seeks damages in excess of $10,000 for plaintiff's loss.
Colonial answered and moved to dismiss pursuant to Rule 12(b)(6). Judge Stephens allowed the motion on the ground the claim was barred by the six-year statute of repose found in N.C.G.S. § 1-50(5). The Court of Appeals reversed.
N.C.G.S. § 1-50(5) provides:
(a) No action to recover damages based upon or arising out of the defective or unsafe condition of an improvement to real property shall be brought more than six years from the later of the specific last act or omission of the defendant giving rise to the cause of action or substantial completion of the improvement.
....
(d) The limitation prescribed by this subdivision shall not be asserted as a defense by any person in actual possession or control, as owner, tenant, or otherwise, of the improvement at the time the defective or unsafe condition constitutes the proximate cause of the injury or death for which it is proposed to bring an action, in the event such person in actual possession or control either knew, or ought reasonably to have known, of the defective or unsafe condition.
N.C.G.S. § 1-50(5)(a), (d) (1983).
The Court of Appeals concluded that because Colonial was in control of the property at the time of its negligent conduct, if any, subsection (d) of the statute excluded plaintiff's claim from the provisions of subsection (a). Applying the ten-year statute of repose, N.C.G.S. 1-52(16), and the three-year statute of limitations, N.C.G.S. 1-52(5), the Court of Appeals held plaintiff's claim was not time-barred.
We conclude that subsection (d) of the statute, by its terms, plainly excludes from subsection (a) any person who is in possession or control of property at the time that person's negligent conduct proximately causes injury or damage to the claimant. This interpretation comports with the purpose of the exclusion, which, we have held, is to place a continuing duty "to inspect and maintain premises" on persons who, after having constructed the property, remain in possession and control. Wilson v. McLeod, 327 N.C. 491, 517, 398 S.E.2d 586, 600 (1990), reh'g denied, 328 N.C. 336, 402 S.E.2d 844 (1991); accord Lamb v. Wedgewood, 308 N.C. 419, 432, 302 S.E.2d 868, 875 (1983) (purpose of exclusion is to preserve claims against those in possession or control who built improvement).
At the time Colonial's conduct proximately caused damage to plaintiff, Colonial was not in possession or control of the property. Plaintiff could not have suffered injury or damage which was legally compensable until she acquired title to the property. Such injury or damage entails a compensable harm to a legally protected interest. Restatement (Second) of Torts § 902 (1970). See also W. Page Keeton et al., Prosser and Keeton on The Law of Torts § 30, at 165 (5th ed. 1984); Charles E. Daye & Mark W. Morris, North Carolina Law of Torts, § 16.91, at 212 (1991). Before plaintiff acquired title to the property, she had no legally protected interest which could have been harmed by Colonial's conduct. See Motor Lines v. General Motors Corp., 258 N.C. 323, 325, 128 S.E.2d 413, 415 (1962); Barbee v. Atlantic Marine Sales & Servs., Inc., 113 N.C.App. 80, 88, 437 S.E.2d 682, 686 (1993), on reh'g, 115 N.C.App. 641, 446 S.E.2d 117 (1994). After she acquired title to the property, Colonial was no longer in possession or control of the property. Therefore, at the earliest time at which plaintiff could have suffered damage (when she acquired title) Colonial was not in possession or control.
Since Colonial was not in possession or control when its allegedly negligent conduct proximately caused plaintiff's damage, the exclusion in subsection (d) of the statute does not apply. Because Colonial's conduct occurred more than six years before plaintiff brought her claim, the six-year statute of repose in subsection (a) bars the claim.
For the foregoing reasons, the decision of the Court of Appeals is reversed.
REVERSED.
NOTES
[1]  Plaintiff brought an action pro se against Colonial on 25 January 1991 in the Small Claims Division of Wake County District Court for recovery of her repair costs. By order entered 25 February 1991, the magistrate dismissed plaintiff's claim with prejudice. Plaintiff appealed. Subsequently plaintiff retained counsel and on 21 June 1991 filed an amended complaint against Colonial in District Court alleging negligence, breach of implied warranties and negligence per se and seeking recovery of damages in excess of $10,000.00. By consent order the action was transferred to Superior Court on 26 August 1991.
