QualType RHSTy;
if (RUE->isArgumentType())
- RHSTy = RUE->getArgumentType();
+ RHSTy = RUE->getArgumentType().getNonReferenceType();
else
RHSTy = RUE->getArgumentExpr()->IgnoreParens()->getType();
int array[10];
int narray = sizeof(array) / sizeof(int &);
int narray2 = sizeof(array) / sizeof(decltype(array[0]));
+
+ int *arrptrs[10]; // expected-note {{array 'arrptrs' declared here}}
+ int len = sizeof(arrptrs) / sizeof(decltype(*arrptrs[0])); // expected-warning {{expression does not compute the number of elements in this array; element type is 'int *', not 'int'}}
+ // expected-note@-1 {{place parentheses around the 'sizeof(decltype(*arrptrs[0]))' expression to silence this warning}}
}
typedef int int32;
-void test(int *p, int **q) { // expected-note 5 {{pointer 'p' declared here}}
+void test(int *p, int **q) { // expected-note 6 {{pointer 'p' declared here}}
const int *r; // expected-note {{pointer 'r' declared here}}
int a1 = sizeof(p) / sizeof(*p); // expected-warning {{'sizeof (p)' will return the size of the pointer, not the array itself}}
int a2 = sizeof p / sizeof *p; // expected-warning {{'sizeof p' will return the size of the pointer, not the array itself}}
int a8 = sizeof(d) / sizeof(int); // expected-warning {{'sizeof (d)' will return the size of the pointer, not the array itself}}
int a9 = sizeof(*q) / sizeof(**q); // expected-warning {{'sizeof (*q)' will return the size of the pointer, not the array itself}}
+ int a10 = sizeof(p) / sizeof(decltype(*p)); // expected-warning {{'sizeof (p)' will return the size of the pointer, not the array itself}}
// Should not warn
int b1 = sizeof(int *) / sizeof(int);