public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10807: [DR 295] It is possible to cv-qualify references even to function types, if the CV qualifications are introduced through a typedef or a template argument
@ 2003-05-15 18:16 giovannibajo
  0 siblings, 0 replies; only message in thread
From: giovannibajo @ 2003-05-15 18:16 UTC (permalink / raw)
  To: gcc-gnats; +Cc: nathan


>Number:         10807
>Category:       c++
>Synopsis:       [DR 295] It is possible to cv-qualify references even to function types, if the CV qualifications are introduced through a typedef or a template argument
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu May 15 18:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Giovanni Bajo
>Release:        3.4
>Organization:
>Environment:
i686-pc-cygwin
>Description:
The following code is legal as per approval of DR 295:

-------------------------------------------------
// CV qualifications through typedefs are ok (and ignored)
typedef void func_type(int);
typedef const volatile func_type cv_func_type;

void func(int) {}
cv_func_type* func_ptr = func;


// CV qualifications through template arguments are ok (and ignored)
template <typename T>
void bar(const volatile T& p)
{
    typedef const volatile T cvT;
    cvT* func = p;

    func(10);
}

int main()
{
    bar(func);
}
-------------------------------------------------
dr295.cpp:3: error: `const volatile' qualifiers cannot be applied to `void ()(int)'
dr295.cpp: In function `int main()':
dr295.cpp:21: error: no matching function for call to `bar(void (&)(int))'


Please, notice that c++/3518 is surely related to this PR.
So, once this is implemented, c++/3518 should be checked
again.
>How-To-Repeat:
Compile the above snippet
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-15 18:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-15 18:16 c++/10807: [DR 295] It is possible to cv-qualify references even to function types, if the CV qualifications are introduced through a typedef or a template argument giovannibajo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).