Re: please review: possible C++ template bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shawn Yarbrough <shawn.yarbrough@xxxxxxxxx> writes:

> Code sample below. I believe this is a gcc compiler bug because line
> 16 gives an error "has not been declared" when the function call in
> question is clearly dependent on the template parameter and therefore
> logically shouldn't be declared until template instantiation.
>
> Section 14.6.2 of the Standard and section C.13.8.1 of Stroustrup seem
> to agree with me, for example from the latter: "Basically, the name of
> a function called is dependent if it is obviously dependent by looking
> at its arguments or at its formal parameters."

Sectoin 14.6.2 seems pretty clear in saying that this is only when the
expression is an unqualified ID.  You wrote
    ::bar(tt);
and ::bar is not an unqualified ID.

    In an expression of the form:
        postfix-expression ( expression-listopt )
    where the postfix-expression is an unqualified-id but not a
    template-id, the unqualified-id denotes a dependent name if and only
    if any of the expressions in the expression-list is a type-dependent
    expression (14.6.2.2).

I don't see anything which says that a qualified name like ::bar can
become dependent because of the function arguments.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux