[clang] [clang] Check null TypeSourceInfo in CreateUnaryExprOrTypeTraitExpr (PR #112111)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 17 08:15:44 PDT 2024
================
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+a() {struct b c (sizeof(b * [({ {tree->d* next)} 0
+
+// expected-error at 3 {{a type specifier is required for all declarations}}
+// expected-error at 3 {{use of undeclared identifier 'tree'; did you mean 'true'?}}
+// expected-error at 3 {{member reference type 'bool' is not a pointer}}
+// expected-error at 3 {{expected ';' after expression}}
+// expected-error at 3 {{use of undeclared identifier 'next'; did you mean 'new'?}}
+// expected-error at 3 {{expected expression}}
+// expected-error at 3 {{expected ';' after expression}}
+// expected-error at 26 {{expected '}'}}
+// expected-note at 3 {{to match this '{'}}
+// expected-error at 26 {{expected ')'}}
+// expected-note at 3 {{to match this '('}}
+// expected-error at 26 {{expected ']'}}
+// expected-note at 3 {{to match this '['}}
+// expected-error at 26 {{expected ')'}}
+// expected-note at 3 {{to match this '('}}
+// expected-error at 3 {{using declaration 'exp' instantiates to an empty pack}}
+// expected-error at 3 {{variable has incomplete type 'struct b'}}
+// expected-note at 3 {{forward declaration of 'b'}}
+// expected-error at 3 {{expected ';' at end of declaration}}
+// expected-error at 26 {{expected '}'}}
+// expected-note at 3 {{to match this '{'}}
+// expected-warning at 3 {{expression result unused}}
----------------
Endilll wrote:
`// expected-no-crash` would be a good name for the directive, but I'm not sure that frontend is a good place for such check layering-wise.
https://github.com/llvm/llvm-project/pull/112111
More information about the cfe-commits
mailing list