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 12970 - Preprocessor macros inside blocks are not annotated by clang_annotateTokens as expected
Summary: Preprocessor macros inside blocks are not annotated by clang_annotateTokens a...
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: libclang (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-28 07:34 PDT by Michał Staromiejski
Modified: 2012-12-11 19:36 PST (History)
1 user (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 Michał Staromiejski 2012-05-28 07:34:41 PDT
In the following C++ code:
===== t.cpp ===
class A
{
#ifdef SOME_MACRO
    // whatever
#endif
};
===============
tokens from preprocessor directives are annotated as 'ClassDecl=A' by clang_annotateTokens. Similarly, clang_getCursor returns cursor of kind ClassDecl.

The same with other blocks like structures, namespaces, enums, functions, etc.
Comment 1 Argyrios Kyrtzidis 2012-05-29 12:13:46 PDT
cloned to <rdar://problem/11548788>
Comment 2 Argyrios Kyrtzidis 2012-12-11 19:36:02 PST
FIxed in r169949