Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #199

Re: What does the standard say about this?

Message-ID <ivt1gu$jjm$1@dont-email.me> (permalink)
Newsgroups comp.std.c++
From Daniel Krügler <daniel.kruegler@googlemail.com>
Subject Re: What does the standard say about this?
Organization A noiseless patient Spider
References <475869c6-b6ad-4f18-96a9-7d969c48c029@y24g2000yqb.googlegroups.com>
Date 2011-07-17 09:51 -0600

Show all headers | View raw


Am 16.07.2011 23:26, schrieb Evan D.:
>
> [Cross post to comp.lang.c++, but I posted it there a while back and
> haven't had any responses. This may be a better newsgroup for it
> anyway.]
>
> I have some code that I don't understand the implications of. GCC
>   4.6.1 (and the earlier versions I've tried) accept it, but EDG does
>   not (specifically, I've tried with Comeau's online front end and
> Intel
>   CC 11.0).
>
> I'm quite familiar with some of the weird name lookup issues that
>   arise when templates and dependent names are involved, but at least
> I
>   would argue that they shouldn't apply in this case. Is it a defect
> in
>   EDG that it rejects it, a defect in GCC that accepts it, or one of
>   those places where the code isn't compliant but compliers aren't
>   required to issue a diagnostic?
>
> EDG reports:
>    error: declaration is incompatible with
>   "ref_ptr<Wrapper<T>::control>
> Wrapper<T>::control::alpha()" (declared
>   at line 9)
>      Wrapper<T>::control::alpha()
>
> in this code:
>      template<  typename T>
>          class ref_ptr {
>      };
>
>     template<typename T>
>      class Wrapper {
>          class control {
>            public:
>              static ref_ptr<control>  alpha();
>          };
>          typedef ref_ptr<control>  controlRefPtr;
>      };
>
>     template<typename T>
>      typename Wrapper<T>::controlRefPtr
>      Wrapper<T>::control::alpha()
>      {
>      }

This example looks like a variant of the open core issue

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2

to me. Following the current non-normative state of the issue, I would
argue that your example is correctly diagnosed as ill-formed, because
the meaning of Wrapper<T>::controlRefPtr depends on the concrete
instantiation of Wrapper<T>.

HTH & Greetings from Bremen,

Daniel Krügler


-- 
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextPrevious in thread | Find similar


Thread

What does the standard say about this? "Evan D." <evaned@gmail.com> - 2011-07-16 15:26 -0600
  Re: What does the standard say about this? Daniel Krügler <daniel.kruegler@googlemail.com> - 2011-07-17 09:51 -0600

csiph-web