C++: handle __uuidof(0)

This commit is contained in:
Nick Rolfe
2018-10-29 12:49:34 +00:00
parent 3e171960dc
commit 9a412c9202
3 changed files with 8 additions and 1 deletions

View File

@@ -497,7 +497,12 @@ class DynamicCast extends Cast, @dynamic_cast {
* specified by the `__declspec(uuid)` attribute.
*/
class UuidofOperator extends Expr, @uuidof {
override string toString() { result = "__uuidof(" + getTypeOperand().getName() + ")" }
override string toString() {
if exists(getTypeOperand()) then
result = "__uuidof(" + getTypeOperand().getName() + ")"
else
result = "__uuidof(0)"
}
override int getPrecedence() { result = 15 }