From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f2ce8bda9cae4ab X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!atl-c02.usenetserver.com!news.usenetserver.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsread.com!newsstand.newsread.com!POSTED.monger.newsread.com!not-for-mail Newsgroups: comp.lang.ada Subject: Re: "Must instantiate controlled types at library level." Why? From: "Peter C. Chapin" References: <2004512-132548-992437@foorum.com> Organization: Kelsey Mountain Software Message-ID: User-Agent: Xnews/5.04.25 Date: Thu, 13 May 2004 02:20:10 GMT NNTP-Posting-Host: 216.114.177.160 X-Complaints-To: Abuse Role , We Care X-Trace: monger.newsread.com 1084414810 216.114.177.160 (Wed, 12 May 2004 22:20:10 EDT) NNTP-Posting-Date: Wed, 12 May 2004 22:20:10 EDT Xref: controlnews3.google.com comp.lang.ada:514 Date: 2004-05-13T02:20:10+00:00 List-Id: Ludovic Brenta wrote in news:2004512-132548- 992437@foorum.com: > Peter, what do you mean when you say your C++ program "works"? Does it > print "I'm in X::f" or "I'm in Y::f"? It "works" in the sense that Y::f was called despite the fact that conceptually Y::f no longer exists. What it doesn't do is produce a compile time error because I created a local class that was derived from a global class. If I understand the earlier post this is the essence of what GNAT was worried about when it complained that I couldn't instantiate a controlled type except at library level. As I said, my earlier program probably invokes undefined behavior. I would be surprised if Standard C++ mandated any kind of sensible response in a case like this. Peter