rejects circular references
Circular references can't be resolved.
For example,
enum E { A = B, B }
parcelable P { const int A = A + 1; }
Bug: 174926968
Bug: 174903521
Test: aidl_unittests
Change-Id: Ief63b3ec2db749d477ad07594cb2797a885ba145
diff --git a/aidl_language.h b/aidl_language.h
index 6638e0e..1df620e 100644
--- a/aidl_language.h
+++ b/aidl_language.h
@@ -601,6 +601,8 @@
std::unique_ptr<AidlTypeSpecifier> ref_type_;
std::string field_name_;
const std::string comments_;
+ mutable bool is_evaluating_ = false; // to prevent re-entrant CheckValid with circular references
+ mutable bool is_validating_ = false; // to prevent re-entrant CheckValid with circular references
};
class AidlUnaryConstExpression : public AidlConstantValue {