[Bug c++/47774] [C++0x] constexpr specifier on ctor not ignored when template instantiation causes ctor to not satify constexpr requirements

dev.lists at jessamine dot co.uk gcc-bugzilla@gcc.gnu.org
Thu Feb 17 08:38:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47774

Adam Butcher <dev.lists at jessamine dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #23369|0                           |1
        is obsolete|                            |

--- Comment #2 from Adam Butcher <dev.lists at jessamine dot co.uk> 2011-02-17 08:34:18 UTC ---
Created attachment 23373
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23373
Fix launch parameter bug with previous attachment

(In reply to comment #1)

Re: attachment 23369

Spotted a bug with options in test case.  One class of ctor specification was
used twice instead of selecting the third.
      -DUSE_SYNTHESIZED_X_CTOR \
      -DGIVE_X_EXPLICIT_CONSTEXPR_CTOR \
  -   -DGIVE_X_EXPLICIT_CONSTEXPR_CTOR
  +   -DGIVE_X_EXPLICIT_NONCONST_CTOR

Updated attachment included revised output below.

Compiling with gcc version 4.6.0 20110217 svn trunk@170240 built this morning
yields:

+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DPLAIN_T -DUSE_SYNTHESIZED_X_CTOR
--------------------------------------------
+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DPLAIN_T
-DGIVE_X_EXPLICIT_CONSTEXPR_CTOR
--------------------------------------------
+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DPLAIN_T
-DGIVE_X_EXPLICIT_NONCONST_CTOR
--------------------------------------------
+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DPLAIN_T_ARRAY
-DUSE_SYNTHESIZED_X_CTOR
--------------------------------------------
+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DPLAIN_T_ARRAY
-DGIVE_X_EXPLICIT_CONSTEXPR_CTOR
constexpr-ctor-templ.cpp: In constructor ‘constexpr X<T>::X() [with T =
ncbool]’:
constexpr-ctor-templ.cpp:148:14:   instantiated from here
constexpr-ctor-templ.cpp:103:24: error: ‘ncbool::ncbool(bool)’ is not
‘constexpr’
--------------------------------------------
+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DPLAIN_T_ARRAY
-DGIVE_X_EXPLICIT_NONCONST_CTOR
--------------------------------------------
+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DFLAG_T -DUSE_SYNTHESIZED_X_CTOR
constexpr-ctor-templ.cpp: In constructor ‘X<ncbool>::X()’:
constexpr-ctor-templ.cpp:100:8: error: ‘constexpr flag<BoolType>::flag(bool)
[with BoolType = ncbool]’ is not ‘constexpr’
constexpr-ctor-templ.cpp: In function ‘int main(int, char**)’:
constexpr-ctor-templ.cpp:148:14: note: synthesized method ‘X<ncbool>::X()’
first required here
--------------------------------------------
+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DFLAG_T
-DGIVE_X_EXPLICIT_CONSTEXPR_CTOR
--------------------------------------------
+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DFLAG_T
-DGIVE_X_EXPLICIT_NONCONST_CTOR
--------------------------------------------
+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DFLAG_T_ARRAY
-DUSE_SYNTHESIZED_X_CTOR
constexpr-ctor-templ.cpp: In constructor ‘constexpr X<ncbool>::X()’:
constexpr-ctor-templ.cpp:100:8: error: ‘constexpr flag<BoolType>::flag(bool)
[with BoolType = ncbool]’ is not ‘constexpr’
constexpr-ctor-templ.cpp:100:8: error: non-constant array initialization
constexpr-ctor-templ.cpp: In function ‘int main(int, char**)’:
constexpr-ctor-templ.cpp:148:14: note: synthesized method ‘X<ncbool>::X()’
first required here
--------------------------------------------
+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DFLAG_T_ARRAY
-DGIVE_X_EXPLICIT_CONSTEXPR_CTOR
constexpr-ctor-templ.cpp: In constructor ‘constexpr X<T>::X() [with T =
ncbool]’:
constexpr-ctor-templ.cpp:148:14:   instantiated from here
constexpr-ctor-templ.cpp:103:24: error: ‘constexpr flag<BoolType>::flag(bool)
[with BoolType = ncbool]’ is not ‘constexpr’
--------------------------------------------
+ g++ -c constexpr-ctor-templ.cpp -std=c++0x -DFLAG_T_ARRAY
-DGIVE_X_EXPLICIT_NONCONST_CTOR
--------------------------------------------
Failed 4



More information about the Gcc-bugs mailing list