User account creation filtered due to spam.

Bug 48319 - [4.6/4.7 Regression] [C++0x] Segmentation fault in instantiation of std::is_constructible<int>
Summary: [4.6/4.7 Regression] [C++0x] Segmentation fault in instantiation of std::is_c...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.1
Assignee: Jason Merrill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-28 17:43 UTC by Takaya Saito
Modified: 2011-03-29 18:58 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-03-29 16:09:36


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Takaya Saito 2011-03-28 17:43:11 UTC
Source file (bug.cc):

#include <type_traits>

int main() {
  static_assert( std::is_constructible<int>::value, "" );
}


Message:

In file included from bug.cc:1:0:
/usr/local/gcc-4.6.0/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/type_traits: In instantiation of ‘const bool std::__is_constructible_helper<int>::__value’:
/usr/local/gcc-4.6.0/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/type_traits:683:12:   instantiated from ‘std::is_constructible<int>’
bug.cc:7:42:   instantiated from here
/usr/local/gcc-4.6.0/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/type_traits:661:71: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Paolo Carlini 2011-03-28 17:58:08 UTC
Looks like a regression. Note, in any case std::is_constructible itself didn't change lately.
Comment 2 Jonathan Wakely 2011-03-28 18:38:37 UTC
reduced

  template<typename Tp> Tp declval() noexcept; 

  template<typename _Tp>
    class __is_constructible_helper
    {
      typedef char __one;
      typedef struct { char __arr[2]; } __two;

      template<typename _Tp1, typename... _Args1>
        static decltype(_Tp1(declval<_Args1>()...), __one()) __test(int);

      template<typename, typename...>
        static __two __test(...);

    public:
      static const bool __value = sizeof(__test<_Tp>(0)) == 1;
    };

  int main() {
    return __is_constructible_helper<int>::__value;
  }
Comment 3 Jason Merrill 2011-03-29 16:09:36 UTC
Mine.
Comment 4 Jason Merrill 2011-03-29 18:47:50 UTC
Author: jason
Date: Tue Mar 29 18:47:47 2011
New Revision: 171688

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171688
Log:
	PR c++/48319
	* pt.c (value_dependent_expression_p): Handle TEMPLATE_ID_EXPR.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/dependent1.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/pt.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 5 Jason Merrill 2011-03-29 18:48:03 UTC
Author: jason
Date: Tue Mar 29 18:47:56 2011
New Revision: 171689

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171689
Log:
	PR c++/48319
	* pt.c (value_dependent_expression_p): Handle TEMPLATE_ID_EXPR.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/dependent1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog
Comment 6 Jason Merrill 2011-03-29 18:58:17 UTC
Fixed.