-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CEA: added testfile illustrating problems with static member vars
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// RUN: rm %t1.ast.json || true | ||
// RUN: clang++ %s -emit-ast -o %t1.ast | ||
// RUN: %S/../../../build/cxx-langstat --analyses=cea -emit-features -in %t1.ast -out %t1.ast.json -- | ||
// RUN: diff %t1.ast.json %s.json | ||
|
||
// Should report one variable that is constexpr, namely "yes". | ||
// | ||
// | ||
|
||
int main(int argc, char** argv){ | ||
|
||
} | ||
|
||
struct C { | ||
// Not reported, as not initialized. | ||
static int no; | ||
// Reported as not constexpr (good), but twice: once here, and once below | ||
// at the definition. Do we want this? | ||
static int no2; | ||
// Not reported, as not init'ed. | ||
static const int no3; | ||
// Corectly reported as constexpr | ||
static constexpr int yes = 1; | ||
}; | ||
|
||
int C::no2 = 2; |