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

            Bug ID: 23234
           Summary: Link error with variable template
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

The following code does not link with Clang r234717:

------------------------------------------------------------------------------
struct f {
    void operator()() const { }
};

template <typename T>
auto vtemplate = f{};

int main() {
    vtemplate<int>();
}
------------------------------------------------------------------------------

Something curious is that replacing

    auto vtemplate = f{};
by
    f vtemplate{};

resolves the problem. Also note that I think the problem was introduced 
recently, because I could almost swear that this compiled fine about a 
week ago.


The exact output is:
› ~/code/llvm/release/bin/clang++ -std=c++1y ~/code/hana/test/worksheet.cpp
Undefined symbols for architecture x86_64:
  "vtemplate<int>", referenced from:
      _main in worksheet-0a36a3.o
ld: symbol(s) not found for architecture x86_64

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to