While the Bible specifies the age of accession for most of the kings of Israel and Judah, Solomon's age is not given. In his dream at Gibeon Solomon describes himself as a נער קטן  which may be part of the reason [Seder Olam][1] says he was twelve years old at accession. Solomon reigned for 40 years and when he died his 41-year-old son Rehoboam became king. Obviously this means Rehoboam was born one year before Solomon's accession. If we accept the Seder Olam figure, this means that Solomon became a father at the age of 11, two years before he had the legal ability to effect a marriage. That a minor cannot effect a marriage is taken as common-knowledge in [the Talmud][2]: קטן שקידש הכל יודעין שאין	קידושי קטן	כלום.   

  [1]: https://www.sefaria.org.il/Seder_Olam_Rabbah.14.2?vhe=Seder_Olam,_Warsaw_1904&lang=he&with=all&lang2=he
  [2]: https://www.sefaria.org.il/Kiddushin.50b.3?ven=William_Davidson_Edition_-_English&vhe=William_Davidson_Edition_-_Aramaic&lang=he&with=all&lang2=he