https://llvm.org/bugs/show_bug.cgi?id=24541

            Bug ID: 24541
           Summary: Eager instantiation of constexpr variables fails if
                    constexpr qualifier is added by static data member
                    definition
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangb...@nondot.org
          Reporter: richard-l...@metafoo.co.uk
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
    Classification: Unclassified

Consider:

template < class T >
struct Foo {
  T v;
  constexpr Foo() : v(){}
  static const Foo f;
};

template < class T >
constexpr const Foo<T> Foo<T>::f = Foo();

std::array<int, Foo<std::size_t>::f.v> a;

Clang rejects this, because it doesn't eagerly instantiate Foo<size_t>::f,
presumably because the constexpr specifier isn't seen until the out-of-line
definition is instantiated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to