[LLVMbugs] [Bug 18870] New: string-literals not handled correctly in linkage-specification

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 17 09:27:19 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18870

            Bug ID: 18870
           Summary: string-literals not handled correctly in
                    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 12078
  --> http://llvm.org/bugs/attachment.cgi?id=12078&action=edit
testcase.cpp

extern R"(C)"   int a;
extern "C" "++" int b;

int main () {

}

---------------------------------------------------

foo.cpp:1:8: error: unknown linkage language
extern R"(C)"   int a;
       ^
foo.cpp:2:12: error: unknown linkage language
extern "C" "++" int b;
           ^
---------------------------------------------------

As specified in [dcl.link]p2:

  Linkage (3.5) between C++ and non-C++ code fragments can be achieved
  using a linkage-specification:

    linkage-specification:
      extern string-literal { declaration-seq_opt }
      extern string-literal declaration

`string-literal` is defined in [lex.string]:

  string-literal:
    encoding-prefix_opt "s-char-sequence_opt"
    encoding-prefix_optR raw-string

concatenation of string-literals is defined under [lex.string]p13:

  In translation phase 6 (2.2), adjacent string literals are concatenated.

---------------------------------------------------

gcc, icc, and msvc all (correctly) accept the provided snippet.

-- 
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/20140217/95989441/attachment.html>


More information about the llvm-bugs mailing list