-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow exception specifications on multi-level indirections.
llvm-svn: 72571
- Loading branch information
Sebastian Redl
committed
May 29, 2009
1 parent
82dbbd7
commit 10b9de4
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// RUN: clang-cc -fsyntax-only -verify %s | ||
|
||
// Straight from the standard: | ||
// Plain function with spec | ||
void f() throw(int); | ||
// Pointer to function with spec | ||
void (*fp)() throw (int); | ||
// Function taking reference to function with spec | ||
void g(void pfa() throw(int)); | ||
// Typedef for pointer to function with spec | ||
typedef int (*pf)() throw(int); // xpected-error spec-on-typedef | ||
|
||
// Some more: | ||
// Function returning function with spec | ||
void (*h())() throw(int); | ||
// Ultimate parser thrill: function with spec returning function with spec and | ||
// taking pointer to function with spec. | ||
// The actual function throws int, the return type double, the argument float. | ||
void (*i() throw(int))(void (*)() throw(float)) throw(double); | ||
// Pointer to pointer to function taking function with spec | ||
void (**k)(void pfa() throw(int)); // no-error | ||
// Pointer to pointer to function with spec | ||
void (**j)() throw(int); // expected-error {{not allowed beyond a single}} | ||
// Pointer to function returning pointer to pointer to function with spec | ||
void (**(*h())())() throw(int); // expected-error {{not allowed beyond a single}} |