================ @@ -87,6 +85,28 @@ bool isStdVariant(const Type *Type) { return isStdType(Type, llvm::StringLiteral("variant")); } +bool isStdAny(const Type *Type) { + return isStdType(Type, llvm::StringLiteral("any")); +} + +bool isVowel(char a) { + switch (a) { + case 'a': + case 'e': + case 'i': + case 'o': + case 'u': + return true; + default: + return false; + } +} + +llvm::StringRef indefiniteArticleBasedOnVowel(char a) { + if (isVowel(a)) + return "an"; + return "a"; +} ---------------- whisperity wrote:
I don't think this is phonetically correct. For example, if I call this for the first letter in the word `union`, which is pronounced as [`YUU-ni-yon` or `YUUN-jen`](http://en.wiktionary.org/wiki/union#English), then it should be **`a union`** and not `an union`. Some more examples: http://english.stackexchange.com/questions/266309/why-is-union-an-exception-to-the-a-an-rule Might be worthwhile to just get rid of this altogether, and refactor the call site like this: `any held a value of 'Union'` or `any contained object of type 'Union'`. https://github.com/llvm/llvm-project/pull/76580 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits