This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77797] New: Unable to use constexpr function as constexpr template parameter
- From: "slavanap at yandex dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Sep 2016 18:04:32 +0000
- Subject: [Bug c++/77797] New: Unable to use constexpr function as constexpr template parameter
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77797
Bug ID: 77797
Summary: Unable to use constexpr function as constexpr template
parameter
Product: gcc
Version: 4.9.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: slavanap at yandex dot ru
Target Milestone: ---
Created attachment 39725
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39725&action=edit
test case that represents and describes the bug
Code in attachment does compile with g++ 5.1.0, but does not with 4.9.3. Here
you can try that online http://melpon.org/wandbox/permlink/hGFy7IEnCycvgvLr
In short, constexpr function as a template parameter with conjunction of
parameter pack expansion does not work with g++ 4.9.3.
Full sample code in the attachment.
Please compile it with
g++ sample.cpp -Wall -Wextra -std=c++11
Note, `(defined _MSC_VER && _MSC_VER < 1900) || (!defined _MSC_VER &&
__cplusplus <= 201103L)` condition will resolve to `true`, because of
`-std=c++11` g++ option.