[LLVMbugs] [Bug 8654] New: clang-as-a-library's preprocessor doesn't trigger Elif, Else and Endif callbacks at the right times
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Nov 20 13:06:18 PST 2010
http://llvm.org/bugs/show_bug.cgi?id=8654
Summary: clang-as-a-library's preprocessor doesn't trigger
Elif, Else and Endif callbacks at the right times
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: richard-llvm at metafoo.co.uk
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=5806)
--> (http://llvm.org/bugs/attachment.cgi?id=5806)
Proposed fix
'dsturtevant' on IRC pointed out that PPCallbacks::Elif, Else and Endif aren't
called if they terminate a preprocessor block which is being skipped due to an
earlier #if or #elif not matching. For instance:
#if 0 // If()
#else // Else() MISSED
#endif // Endif()
#if 0 // If()
#elif 1 // Elif() MISSED
#else // Endif()
#if 0 // If()
#endif // Endif() MISSED
I've put together a patch which should fix this but it's untested (there don't
seem to be any tests of the PPCallbacks stuff to model such a test on).
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list