Open llvmbot opened 8 years ago
mentioned in issue llvm/llvm-bugzilla-archive#38106
Here is another test case with the same fail on Linux and Windows. gcc and MSVC compile it.
#include <stdio.h>
template <class charT>
struct basic_string
{
static const int npos;
basic_string(int = npos) {;}
};
basic_string<char> s;
template <class charT>
const int
basic_string<charT>::npos = -1;
extern "C" { int puts(const char *); }
int main() {
puts("Should compile without ACCVIOing");
}
Extended Description
The below program (also attached) produces an undefined reference to
Foo::Bar<int>::m
when m is declared asconst
. Just compile it withclang++ test.cpp
. It does not compile with the latest clang from the trunk, nor with clang 3.5.However, when m does not have any additional qualifiers or when m is declared as
const
volatile, then the program compiles, links, and runs. You can verify this by defining QUALS as empty or asconst volatile
.GCC compiles and links the program fine.
This code was distilled from xulrunner 24.8.0.