Index: clang/lib/Parse/ParseDecl.cpp =================================================================== --- clang/lib/Parse/ParseDecl.cpp +++ clang/lib/Parse/ParseDecl.cpp @@ -3943,6 +3943,7 @@ // OpenCL 2.0 and later define this keyword. OpenCL 1.2 and earlier // should support the "pipe" word as identifier. Tok.getIdentifierInfo()->revertTokenIDToIdentifier(); + Tok.setKind(tok::identifier); goto DoneWithDeclSpec; } isInvalid = DS.SetTypePipe(true, Loc, PrevSpec, DiagID, Policy); Index: clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl =================================================================== --- clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl +++ clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl @@ -1,3 +1,9 @@ // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -void foo(read_only pipe int p); // expected-error {{expected parameter declarator}} expected-error {{expected ')'}} expected-note {{to match this '('}} +void foo(read_only pipe int p); +// expected-warning@-1 {{type specifier missing, defaults to 'int'}} +// expected-error@-2 {{access qualifier can only be used for pipe and image type}} +// expected-error@-3 {{expected ')'}} expected-note@-3 {{to match this '('}} + +// 'pipe' should be accepted as an identifier. +typedef int pipe;