Skip to content

-fms-compatibility: Clang should form a wide string literal from L#macro_arg in a function-like macro #10356

Closed
@llvmbot

Description

Bugzilla Link 9984
Resolution FIXED
Resolved on Dec 14, 2014 22:19
Version trunk
OS All
Blocks llvm/llvm-bugzilla-archive#13707
Reporter LLVM Bugzilla Contributor
CC @alexey-bataev,@majnemer,@DougGregor,@zmodem,@zygoloid,@rnk

Extended Description

the following code produces an error:

#define TESTL(x) L#x
const wchar_t* a = L"Hello World";
const wchar_t* b = TESTL(Hello World);

The preprocessor appears to ignore the L inside the define as the literal declaring the string as a wide string. The code not using the macro passes without error.

Here is the analyzer output:

"Use of undeclared identifier 'L'"

This fails on both using the analyzer that ships with XCode 4.0.1 as well as svn trunk (test at revision 131851).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions