LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 12767 - The preprocessor doesn't inhibit expansion when concatenating with an empty token
Summary: The preprocessor doesn't inhibit expansion when concatenating with an empty t...
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: C++11 (show other bugs)
Version: trunk
Hardware: All All
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
: 15661 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-08 13:05 PDT by Paul
Modified: 2013-05-24 20:36 PDT (History)
7 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul 2012-05-08 13:05:25 PDT
The preprocessor doesn't inhibit expansion when concatenating with an empty token.
Here an example:

#define EMPTY()
#define DEFER(id) id EMPTY()

#define A(p, ...) p ## __VA_ARGS__ // should inhibit expansion of ...
                                   
#define B(p, ...) p __VA_ARGS__

#define TEST() 123

A(, DEFER(TEST)()) // should be TEST (), but clang expands to 123
B(, DEFER(TEST)()) // should be 123
Comment 1 Harald van Dijk 2013-04-03 13:33:15 PDT
*** Bug 15661 has been marked as a duplicate of this bug. ***
Comment 2 Argyrios Kyrtzidis 2013-05-24 20:36:41 PDT
Fixed in r182699.