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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to