[llvm-bugs] [Bug 43963] New: out-of-line definition does not match any declaration in class (declaration contains expression which involves variable template defined inside the class)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 11 08:16:29 PST 2019


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

            Bug ID: 43963
           Summary: out-of-line definition does not match any declaration
                    in class (declaration contains expression which
                    involves variable template defined inside the class)
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Keywords: compile-fail
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nok.raven at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

template <bool>
struct S {};

struct X {
    enum E { A };

    template<E e>
    inline static constexpr bool q = A == e;

    template <E e>
    S<q<e>>* foo();
    //S<X::q<e>>* foo(); // this one compiles
};

template <X::E e>
S<X::q<e>>* X::foo() {
    return 0;
}

int main() {
    X().foo<X::A>();
}

GCC has problems with this too
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92459

https://godbolt.org/z/Z4nP5k

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191111/0312a825/attachment-0001.html>


More information about the llvm-bugs mailing list