From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12405 invoked by alias); 15 May 2003 18:16:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 12351 invoked by uid 71); 15 May 2003 18:16:00 -0000 Resent-Date: 15 May 2003 18:16:00 -0000 Resent-Message-ID: <20030515181600.12350.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nathan@codesourcery.com Resent-Reply-To: gcc-gnats@gcc.gnu.org, giovannibajo@libero.it Received: (qmail 27363 invoked by uid 48); 15 May 2003 18:08:31 -0000 Message-Id: <20030515180831.27362.qmail@sources.redhat.com> Date: Thu, 15 May 2003 18:16:00 -0000 From: giovannibajo@libero.it Reply-To: giovannibajo@libero.it To: gcc-gnats@gcc.gnu.org Cc: nathan@codesourcery.com X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify: nathan@codesourcery.com Subject: 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 X-SW-Source: 2003-05/txt/msg01811.txt.bz2 List-Id: >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 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: