Skip to content

Commit da68a15

Browse files
authored
Merge pull request #6380 from akyrtzi/pr/stable/fix-cached-diags
[stable][clang][cas] Fix issues with cached diagnostics
2 parents aced64e + 158dcef commit da68a15

File tree

5 files changed

+336
-73
lines changed

5 files changed

+336
-73
lines changed

clang/include/clang/Basic/SourceManager.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ class ExpansionInfo {
381381
: ExpansionLocEnd;
382382
}
383383

384+
/// The actual value of \c ExpansionLocEnd, useful for serialization purposes.
385+
SourceLocation getUnderlyingExpansionLocEnd() const {
386+
return ExpansionLocEnd;
387+
}
388+
384389
bool isExpansionTokenRange() const { return ExpansionIsTokenRange; }
385390

386391
CharSourceRange getExpansionLocRange() const {

clang/test/CAS/cached-diagnostics.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,11 @@ PRAG("unknown2")
7070
void test(int x) {
7171
if (x=0) {}
7272
}
73+
74+
#define DEPR _Pragma("GCC warning \"name is deprecated\"")
75+
#define PARAM "A" DEPR
76+
#define MAC(x) x
77+
78+
void test2() {
79+
(void)MAC(PARAM);
80+
}

0 commit comments

Comments
 (0)