
386 A.2d 1090 (1978)
Cyril J. REDMOND et al.
v.
RHODE ISLAND HOSPITAL TRUST NATIONAL BANK, Trustee, et al.
No. 76-412-Appeal.
Supreme Court of Rhode Island.
May 15, 1978.
Edwards & Angell, John V. Kean, George W. Shuster, Providence, for plaintiffs.
Tillinghast, Collins & Graham, Edwin H. Hastings, Providence, for Rhode Island Hospital Trust Nat. Bank, Trustee U/W/O Mary Isabelle Neilson.
Hinckley, Allen, Salisbury & Parsons, Ronald C. Green, Jr., Stephen J. Carlotti, Silas B. Foot, III, Providence, for Hollis Hunnewell and Harry C. Cushing, IV.
Swan, Jenckes, Asquith & Davis, Andrew H. Davis, Jr., Henry M. Swan, Providence, for Andrew H. Davis, Jr., guardian ad litem and representative of contingent interests with respect to personal representatives of Isabelle Kemp.

OPINION
WEISBERGER, Justice.
This case comes before the court on an appeal from a judgment of the Superior Court dismissing the plaintiffs' complaint filed pursuant to the Uniform Declaratory Judgments Act, G.L.1956 (1969 Reenactment) chapter 30 of title 9. The judgment of dismissal was rendered pursuant to Rule 12(b)(6) of the Superior Court Rules of Civil Procedure which authorizes dismissal for "failure to state a claim upon which relief can be granted."
The complaint sought a construction of Clause "SEVENTH" of the will of Mary Isabelle Neilson who died in Newport on May 14, 1928. At the time of her death she was survived by a son, Jules Blanc Neilson, who later died on August 10, 1945. She had given birth to two daughters, Mary Isabelle Hunnewell and Cathleen Vanderbilt Colford, both of whom predeceased her. The *1091 testatrix was also survived by three children of her son, Jules Blanc Neilson: namely, Frederic W. Neilson who died August 22, 1937, and was survived by one child, Frederic William Gebhard Neilson, plaintiffs' decedent; Alexander Milburn Neilson who died without issue on September 7, 1938; and defendant Isabelle Neilson who was at the time of hearing alive, under guardianship, unmarried, 67 years of age and without issue.
Clause "SEVENTH" of the will of Mary Isabelle Neilson purported to devise and bequeath the residue of the testatrix' estate in trust and for the benefit of three grandchildren, Frederic W. Neilson, Alexander Milburn Neilson and Isabelle Neilson during their lifetimes and upon the death of any such grandchild for the benefit of his or her issue. In the event that any grandchild died without issue, his or her share would go per stirpes to the issue, if any, of the other grandchildren named in Clause "SEENTH" of the will. All of the persons named in Clause "SEVENTH" are dead, except Isabelle Neilson, who has no issue. The only issue of the deceased grandchildren was Frederic William Gebhard Neilson, who is also deceased, and of whose will plaintiffs are the executors.
The will makes no provision for disposition of the property considered under Clause "SEVENTH" in the event of a complete failure of issue on the part of the three grandchildren who were the life tenants.
In the complaint the suggestion was made that a reversionary interest or a resulting trust might arise upon the death of the last life tenant in favor of the heirs of the testatrix. The testatrix had three other grandchildren who were not named or referred to in Clause "SEVENTH" of the will: namely, Hollis Hunnewell and Isabelle Kemp, the children of her predeceased daughter, Mary Isabelle Hunnewell; and Cathleen Vanderbilt Arostegui, the sole child of her predeceased daughter, Cathleen Vanderbilt Colford. Isabelle Kemp died without issue on or about July 6, 1965. Cathleen Vanderbilt Arostegui died on January 26, 1944, survived by her husband (whose whereabouts are unknown) and one son, Henry C. Cushing IV, who is still living. In the event of an intestacy as to the remaining portion of the trust estate upon the death of the last life tenant, the plaintiffs' decedent might be entitled to a one-sixth share, depending upon the time of the determination of the identity of the heirs of the testatrix. In the event that the heirs were to be determined as of the date of the death of the testatrix in 1928, plaintiffs' decedent would be entitled to share in the proceeds. In the event that the heirs of the testatrix were determined as of the date of death of the last life tenant, now still living and 67 years of age, the estate of plaintiffs' decedent would not share in the proceeds.
There is presently pending a determination by the Internal Revenue Service concerning the value of the interest of plaintiffs' decedent in the trust property. A subsidiary question relating to this determination, if the heirs of the testatrix are determined as of the time of her death, is whether the interest acquired by the estate of plaintiffs' decedent is a contingent interest or a vested interest. This uncertainty arises from the common law presumption against failure of issue of a living person.
This court has recognized the appropriateness of construing instruments where such construction will be given binding force for federal tax purposes. Industrial National Bank v. Rhode Island Hospital, 99 R.I. 289, 207 A.2d 286 (1965). To a similar effect was a decision of the Supreme Judicial Court of Massachusetts in Billings v. Fowler, 361 Mass. 230, 279 N.E.2d 906 (1972). In the past, the correct procedure for obtaining judicial construction of a will was by way of a suit in Superior Court and certification of the case to this court under § 9-24-28. Gray v. Leeman, 94 R.I. 451, 182 A.2d 119 (1962). The repeal of that section by P.L.1972, ch. 169, § 11, however, leaves the Declaratory Judgments Act as the proper vehicle for bringing a will construction suit like the one before us now.
Under the provisions of § 9-30-6, a trial justice may, in the exercise of sound judicial *1092 discretion, refuse to enter a judgment "where such judgment or decree, if rendered or entered, would not terminate the uncertainty or controversy giving rise to the proceeding." In this instance, the trial justice dismissed the petition on the ground that the matter would not be ripe for determination until the death of defendant Isabelle Neilson. The court held that the tax problem of plaintiffs' decedent would not be sufficient under the terms of chapter 30 of title 9, although a different holding was indicated in Industrial National Bank v. Rhode Island Hospital, supra, wherein a will was construed pursuant to the provisions of § 9-24-28.
Without negating in any way the discretion of a trial justice to withhold determination under § 9-30-6, a threshold question arises as to whether such determination may be made on a motion to dismiss under Rule 12(b)(6) of the Superior Court Rules of Civil Procedure. In Salem National Bank v. City of Salem, 47 Ill.App.2d 279, 198 N.E.2d 137 (1964), the court indicated there was a distinction between the granting of declaratory relief and the entertaining of the action. The court determined that the discretion was not one to entertain the action but was only one to enter or to decline entry of judgment. In Miller v. Currie, 208 Wis. 199, 242 N.W. 570 (1932), the court considered the appropriateness of sustaining a demurrer to a complaint wherein a declaratory judgment was sought relating to the legitimacy of the plaintiff as the issue of a common law marriage. In reversing the decision sustaining the demurrer, the court observed:
"Numerous contentions were made in the argument and in briefs of counsel here, some of which at least require us to assume the existence of facts not alleged in the complaint, and are questions which relate to the exercise of discretion by the court as to whether or not jurisdiction of the action should be entertained. By the very words of the statute the discretion given to the court is not a discretion to entertain the action but to enter or decline to enter the judgment or decree. The discretion conferred by sub. (6) may therefore be exercised only upon the record as it exists when the entry of a judgment would be appropriate." Id. at 203, 242 N.W. at 571.
In Wooster v. Union & New Haven Trust Co., 132 Conn. 309, 43 A.2d 734 (1945), on a petition for declaratory relief wherein substantial tax questions relating to a power of appointment were included, the court made the following comment:
"[P]laintiff is entitled to know the scope of the power of appointment given her in order to guide her in her future conduct; and it is stipulated that a present determination of the questions will resolve substantial doubts as to the taxability of portions of the principal of the fund under the federal inheritance tax laws." Id. at 313, 43 A.2d at 736.
This court, in construing Rule 12(b)(6) of the Superior Court Rules of Civil Procedure, has ruled that a complaint should not be dismissed on the grounds of a failure to state a claim upon which relief can be granted unless it is clear beyond a reasonable doubt that the plaintiff is not entitled to relief no matter what set of facts might be proved in support of the claim. Bragg v. Warwick Shoppers World, Inc., 102 R.I. 8, 227 A.2d 582 (1967). Later, however, in Employers' Fire Insurance Co. v. Beals, 103 R.I. 623, 240 A.2d 397 (1968), we recognized that although the allegations of a complaint seeking a declaratory judgment might be legally sufficient to invoke the court's jurisdiction, the trial justice still retained discretion as to whether the complaint should be dismissed even though the litigation was still in the pleading stage. In Beals we upheld the dismissal of a complaint prior to hearing because the pleadings made it clear that while the insurer was seeking to obtain a declaration as to the extent of its obligation to defend the insured, it was actually attempting to adjudicate an issue which was inextricably entwined with the issue in a pending suit regarding the insured's liability to the injured party. Here, the plaintiffs are not attempting to obtain a ruling on an issue that is waiting to be litigated in another *1093 case. The controversy now before us, at least at this juncture, appears to be an ideal candidate for declaratory relief. In the case at bar, the defendant trustee has conceded that the time of the determination of the heirs of the testatrix following principles set forth in Champagne v. Fortin, 69 R.I. 10, 30 A.2d 838 (1943), may be a matter involving some controversy. Although this court has indicated that pursuant to the general rule of construction the testator would be deemed to intend that those answering the description of his heirs should be determined as of the date of his death, this rule may be modified where a contrary intention is expressed in the will. The trustee states in its brief that the context and the language used could well be found to be the basis for a modification of the strict rule of law as set forth in Champagne, supra.
In the light of the substantial questions which are at issue here, this court is of the opinion that the granting of a motion to dismiss pursuant to Rule 12(b)(6) of the Superior Court Rules of Civil Procedure is not in accordance with the principles set forth in Bragg, even read in the light of Beals.
As a consequence the appeal of the plaintiffs is sustained, the judgment dismissing the complaint is reversed, and the case is remanded to the Superior Court for further proceedings.
