<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - ##__VA_ARGS__ does not expand inner macros, whereas __VA_ARGS__ works as expected"
href="http://llvm.org/bugs/show_bug.cgi?id=19141">19141</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>##__VA_ARGS__ does not expand inner macros, whereas __VA_ARGS__ works as expected
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.4
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jeffery.thomas@gm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>##__VA_ARGS__ does not expand inner macros, whereas __VA_ARGS__ works as
expected.
This input file (foo.m):
[--
#define F1(...) [NSString stringWithFormat:__VA_ARGS__]
#define F2(format, ...) [NSString stringWithFormat:(format), ##__VA_ARGS__]
NSLog(F1(@"%@", F1(@"%@", @"a")));
NSLog(F2(@"%@", F2(@"%@", @"a")));
--]
when processed with `clang -E -o foo.i foo.m`, produces the following output:
[--
# 1 "foo.m"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 178 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "foo.m" 2
NSLog([NSString stringWithFormat:@"%@", [NSString stringWithFormat:@"%@",
@"a"]]);
NSLog([NSString stringWithFormat:(@"%@"), F2(@"%@", @"a")]);
--]
Version Details:
[--
$ clang --version
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
--]</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>