From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27367 invoked by alias); 24 Jan 2013 06:39:58 -0000 Received: (qmail 23210 invoked by uid 48); 24 Jan 2013 06:39:14 -0000 From: "spoo at zarbosoft dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56095] Crash casting function pointer as non-type template argument Date: Thu, 24 Jan 2013 06:39:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: spoo at zarbosoft dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg02255.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D56095 --- Comment #1 from Rendaw 2013-01-24 06:39:12 = UTC --- I tried one more case, casting before using the template: Code (c.cxx): int *a(void) { return 0; } typedef void (*IntermediarySignature)(void); template void z(void) {} int main(int argc, char **argv) { constexpr IntermediarySignature c =3D (IntermediarySignature)a; z(); return 0; } 4.7 output: > g++-4.7 -std=3Dc++11 c.cxx=20 c.cxx: In function =E2=80=98int main(int, char**)=E2=80=99: c.cxx:8:7: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Preprocessed source stored into /tmp/ccw2QOq9.out file, please attach this = to your bugreport. 4.6 output: > g++ -std=3Dc++0x c.cxx=20 c.cxx: In function =E2=80=98int main(int, char**)=E2=80=99: c.cxx:8:7: error: =E2=80=98(IntermediarySignature)a=E2=80=99 is not a valid= template argument for type =E2=80=98void (*)()=E2=80=99 because function =E2=80=98#=E2=80=98n= op_expr=E2=80=99 not supported by dump_decl#=E2=80=99 has not external linkage c.cxx:8:7: error: no matching function for call to =E2=80=98z()=E2=80=99 c.cxx:8:7: note: candidate is: c.cxx:3:41: note: template void z()