[LLVMbugs] [Bug 18839] New: thread_local variable declaration treated as definition in direct linkage-specification
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Feb 14 07:49:41 PST 2014
http://llvm.org/bugs/show_bug.cgi?id=18839
Bug ID: 18839
Summary: thread_local variable declaration treated as
definition in direct linkage-specification
Product: clang
Version: 3.4
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: filip.roseen at gmail.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 12062
--> http://llvm.org/bugs/attachment.cgi?id=12062&action=edit
testcase.cpp
main.cpp:
--------------------------------------------------------------------------------
extern "C++" thread_local int x;
int main () {
x = 123;
}
clang++ -pthread -Wall -pedantic -std=c++11 main.cpp
--------------------------------------------------------------------------------
<SUCCESS>
================================================================================
The standard states that a declaration directly contained in a
linkage-specification shall be treated as being declared as `extern`.
We should (with the above in mind) get a linker-error saying that `x` is
undefined within `main` but clang happily compiles our snippet.
gcc issues the correct diagnostic.
[dcl.link] /7
> A declaration directly contained in a linkage-specification is
> treated as if it contains the extern specifier (7.11) for the
> purpose of determining the linkage of the declared namd and
> whether it is a definition. Such declaration shall not specify a
> storage class.
--
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/20140214/a4dd7769/attachment.html>
More information about the llvm-bugs
mailing list