From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4855 invoked by alias); 13 Nov 2012 14:16:47 -0000 Received: (qmail 4421 invoked by uid 48); 13 Nov 2012 14:16:14 -0000 From: "niels at penneman dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55311] New: Cannot specialize template parameter of type 'const char *const' in 'using' alias Date: Tue, 13 Nov 2012 14:16:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: niels at penneman dot org 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: 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: 2012-11/txt/msg01151.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55311 Bug #: 55311 Summary: Cannot specialize template parameter of type 'const char *const' in 'using' alias Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: niels@penneman.org When providing arguments for a template class in a 'using' alias, specifying arguments of type 'const char *const' doesn't work. It does work for an 'in= t' pointer. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D GCC version: $ gcc -### Using built-in specs. COLLECT_GCC=3D/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0-alpha20121111/gcc COLLECT_LTO_WRAPPER=3D/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.0-alpha20121= 111/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.8.0_alpha20121111/work/gcc-4.8-20121111/co= nfigure --prefix=3D/usr --bindir=3D/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0-alpha2012= 1111 --includedir=3D/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0-alpha20121111/include --datadir=3D/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-alpha20121111 --mandir=3D/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-alpha20121111/man --infodir=3D/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-alpha20121111/info --with-gxx-include-dir=3D/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0-alpha201211= 11/include/g++-v4 --host=3Dx86_64-pc-linux-gnu --build=3Dx86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --disable-ppl-version-check --with-cloog-include=3D/usr/include/cloog-ppl --enable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --with-multilib-list=3Dm32,m64 --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=3D/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-alpha20121111= /python --enable-checking=3Drelease --disable-libgcj --disable-libquadmath --enable-languages=3Dc,c++ --enable-shared --enable-threads=3Dposix --enable-__cxa_atexit --enable-clocale=3Dgnu --enable-targets=3Dall --with-bugurl=3Dhttp://bugs.gentoo.org/ --with-pkgversion=3D'Gentoo 4.8.0_alpha20121111' Thread model: posix gcc version 4.8.0-alpha20121111 20121111 (experimental) (Gentoo 4.8.0_alpha20121111) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Code that fails to compile: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D template struct A {}; extern constexpr char HELLO_WORLD[] =3D "hello world"; template using PartiallySpecialized =3D A; int main(int, char **) { A original; PartiallySpecialized ps; } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Compiler invocation/output: $ g++ -std=3Dc++11 -Wall -Wextra strbug.cxx=20 strbug.cxx:8:46: error: =E2=80=98"hello world"=E2=80=99 is not a valid temp= late argument of type =E2=80=98const char*=E2=80=99 because =E2=80=98"hello world"=E2=80=99 = is not a variable using PartiallySpecialized =3D A; ^ strbug.cxx: In function =E2=80=98int main(int, char**)=E2=80=99: strbug.cxx:12:22: warning: unused variable =E2=80=98original=E2=80=99 [-Wun= used-variable] A original; ^ strbug.cxx:13:28: warning: unused variable =E2=80=98ps=E2=80=99 [-Wunused-v= ariable] PartiallySpecialized ps; ^ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Notice the first instantiation ('original') does not generate any errors or warnings. The second instantiation ('ps') should be identical to the second. Above code compiles without warnings and without errors on Clang 3.1.