forked from OSchip/llvm-project
Make sure that restrict-qualifying an array actually adds a restrict qualifier. PR11354. (operator bool() is evil!)
llvm-svn: 144355
This commit is contained in:
parent
c12c211c44
commit
4f64e1819b
|
@ -2032,8 +2032,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
|
|||
ASM = ArrayType::Normal;
|
||||
D.setInvalidType(true);
|
||||
}
|
||||
T = S.BuildArrayType(T, ASM, ArraySize,
|
||||
Qualifiers::fromCVRMask(ATI.TypeQuals),
|
||||
T = S.BuildArrayType(T, ASM, ArraySize, ATI.TypeQuals,
|
||||
SourceRange(DeclType.Loc, DeclType.EndLoc), Name);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic
|
||||
// PR1892
|
||||
void f(double a[restrict][5]); // should promote to restrict ptr.
|
||||
void f(double (* restrict a)[5]);
|
||||
|
||||
// PR1892, PR11354
|
||||
void f(double a[restrict][5]) { __typeof(a) x = 10; } // expected-warning {{(aka 'double (*restrict)[5]')}}
|
||||
|
||||
int foo (__const char *__path);
|
||||
int foo(__const char *__restrict __file);
|
||||
|
|
Loading…
Reference in New Issue