https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88095

            Bug ID: 88095
           Summary: class nontype template parameter UDL string literals
                    doesn't accepts deduction placeholder
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hanicka at hanicka dot net
  Target Milestone: ---

Created attachment 45035
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45035&action=edit
small example

I tried CNTTP support for string literals, and gives me error:

error: literal operator template 'constexpr bool operator""_test()' has invalid
parameter list;  Expected non-type template parameter pack <char...>   or
single non-type parameter of class type


It should (by
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0732r2.pdf) accept
deduction placeholder:

template <fixed_string fs> constexpr bool operator"" _test() {
        return true;
}

(whole example in attachment)

GCC 9.0 head (20f6624)

-------------------------


g++-HEAD -v -save-temps -std=c++2a cnttp3.cpp
Using built-in specs.
COLLECT_GCC=g++-HEAD
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/HEAD-20f6624/libexec/gcc/x86_64-apple-darwin18.2.0/9.0.0/lto-wrapper
Target: x86_64-apple-darwin18.2.0
Configured with: ../configure --build=x86_64-apple-darwin18.2.0
--prefix=/usr/local/Cellar/gcc/HEAD-20f6624
--libdir=/usr/local/Cellar/gcc/HEAD-20f6624/lib/gcc/HEAD
--enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-HEAD
--with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr
--with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl
--with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC
HEAD-20f6624' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues
--disable-nls --disable-multilib --with-native-system-header-dir=/usr/include
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Thread model: posix
gcc version 9.0.0 20181118 (experimental) (Homebrew GCC HEAD-20f6624) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++2a'
'-mmacosx-version-min=10.14.0' '-asm_macosx_version_min=10.14' '-shared-libgcc'
'-mtune=core2'

/usr/local/Cellar/gcc/HEAD-20f6624/libexec/gcc/x86_64-apple-darwin18.2.0/9.0.0/cc1plus
-E -quiet -v -D__DYNAMIC__ cnttp3.cpp -fPIC -mmacosx-version-min=10.14.0
-mtune=core2 -std=c++2a -fpch-preprocess -o cnttp3.ii
ignoring nonexistent directory
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory
"/usr/local/Cellar/gcc/HEAD-20f6624/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/../../../../../../x86_64-apple-darwin18.2.0/include"
ignoring nonexistent directory
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/Cellar/gcc/HEAD-20f6624/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/../../../../../../include/c++/9.0.0

/usr/local/Cellar/gcc/HEAD-20f6624/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/../../../../../../include/c++/9.0.0/x86_64-apple-darwin18.2.0

/usr/local/Cellar/gcc/HEAD-20f6624/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/../../../../../../include/c++/9.0.0/backward

/usr/local/Cellar/gcc/HEAD-20f6624/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/include

/usr/local/Cellar/gcc/HEAD-20f6624/lib/gcc/HEAD/gcc/x86_64-apple-darwin18.2.0/9.0.0/include-fixed
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++2a'
'-mmacosx-version-min=10.14.0' '-asm_macosx_version_min=10.14' '-shared-libgcc'
'-mtune=core2'

/usr/local/Cellar/gcc/HEAD-20f6624/libexec/gcc/x86_64-apple-darwin18.2.0/9.0.0/cc1plus
-fpreprocessed cnttp3.ii -fPIC -quiet -dumpbase cnttp3.cpp
-mmacosx-version-min=10.14.0 -mtune=core2 -auxbase cnttp3 -std=c++2a -version
-o cnttp3.s
GNU C++17 (Homebrew GCC HEAD-20f6624) version 9.0.0 20181118 (experimental)
(x86_64-apple-darwin18.2.0)
        compiled by GNU C version 9.0.0 20181118 (experimental), GMP version
6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.20-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++17 (Homebrew GCC HEAD-20f6624) version 9.0.0 20181118 (experimental)
(x86_64-apple-darwin18.2.0)
        compiled by GNU C version 9.0.0 20181118 (experimental), GMP version
6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.20-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: ac5ba3fc9d630765279df693b1849957
cnttp3.cpp:12:1: error: literal operator template 'constexpr bool
operator""_test()' has invalid parameter list;  Expected non-type template
parameter pack <char...>   or single non-type parameter of class type
   12 | }
      | ^

Reply via email to