Skip to content

compiler error when accessing a static constexpr value of struct #25947

@llvmbot

Description

@llvmbot
Bugzilla Link 25573
Version 3.7
OS Linux
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@zygoloid

Extended Description

// The following code compiles in gcc (http://goo.gl/gFGc9K), but not clang (http://goo.gl/woxdi1).
#include <type_traits>
template<class T> struct Foo { Foo(T = nullptr) {} };
using U = std::is_constructible<Foo<int>>;
bool b = U::value;  // If we remove this line, it compiles in both gcc and clang. 
                    // However the value of `b` is true, which is counterintuitive.
int main() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++11clang:frontendLanguage frontend issues, e.g. anything involving "Sema"invalidResolved as invalid, i.e. not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions